War ich schon so lange nicht mehr da? Die Hilfe war auch mal besser.
He he
nur nicht zu Sachen hinreißen lassen, die du später bereust. ![]()
Du hast doch sicher schon bemerkt, dass 90% der Excel-Fragen von mir beantwortet werden, anscheinend verlassen sich da auch die andren drauf. ![]()
Und ich habe deinen Thread erst heute auf dem Schirm (manchmal hat man auch noch andere Dinge zu tun
).
Ich werde es mir jetzt mal anschauen. Ich hoffe du kannst solange noch aushalten...
So, habs dir mal zusammengeschossen ![]()
Spoiler anzeigen
#include <File.au3>
#include <Excel.au3>
Local $pathTXT = "PFAD_TXT_DATEI"
Local $a
_FileReadToArray($pathTXT, $a)
Local $pathXLS = "PFAD_EXCEL_DATEI"
Local $oExcel = _ExcelBookNew(0) ; oder _ExcelBookOpen(), falls vorhanden
For $i = 1 To $a[0]
Select
Case StringInStr($a[$i], 'Hostname:', 1)
$ret = StringRegExp($a[$i], '(?:: )(\w+)', 1)
$oExcel.Range("A1").Value = $ret[0]
Case StringInStr($a[$i], 'Betriebssystemname:', 1)
$ret = StringRegExp($a[$i], '(?:: )([\w ]+)', 1)
$oExcel.Range("B1").Value = $ret[0]
Case StringInStr($a[$i], 'Ursprüngliches Installationsdatum:', 1)
$ret = StringRegExp($a[$i], '(?:: )(\d{2}\.\d{2}\.\d{4}, \d{2}:\d{2}:\d{2})', 1)
$oExcel.Range("C1").Value = $ret[0]
Case StringInStr($a[$i], 'Systemhersteller:', 1)
$ret = StringRegExp($a[$i], '(?:: )([\w .-]+)', 1)
$oExcel.Range("D1").Value = $ret[0]
Case StringInStr($a[$i], 'Systemmodell:', 1)
$ret = StringRegExp($a[$i], '(?:: )([\w .-]+)', 1)
$oExcel.Range("E1").Value = $ret[0]
ExitLoop
Case Else
ContinueLoop
EndSelect
Next
_ExcelBookSaveAs($oExcel, $pathXLS) ; oder _ExcelBookSave($oExcel), falls Datei vorhanden
_ExcelBookClose($oExcel)