wickie666
Goto Top

Zeilen sequentiell aus 3 Textdateien auslesen

Ist es möglich aus 3 Textdateien sequentiell Zeilen auszulesen und die Strings in eine andere zu schreiben?
Ich habe drei Textdateien, die jeweils die identische anzahl an zeilen besitzen. die drei sollen so zusammengefügt werden, dass z.b. jeweils die erste zeile der 3 Dateien, zur ersten zeile der neuen txt zusammengefügt werden, dann die nächste usw.

Das auslesen von einer Textdatei und zusammenfügen von 3 hintereinanderfolgenden zeilen zu einer, habe ich hier schon beantwortet bekommen:

@echo off
echo AREA Name DESC>sortiert.txt
set line=
set /a count=0
FOR /f "delims=" %%f IN ('type "MODULES_1.txt"') DO call :ProcessLine "%%f")  
(echo %line%)>>sortiert.txt
goto :eof
:ProcessLine
if %count%==0 goto :NewLine
set /a count+=1
If %count% GTR 3 goto :NewLine
set "line=%line% %~1"  
goto :eof
:NewLine
If %count% neq 0 (echo %line%)>>sortiert.txt
set "line=%~1"  
set /a count=1
goto :eof


, aber das schaff ich nun mal nicht ohne hilfe. Kann ich auf oben genannten code aufsetzen?
Ich hab keine idee ...

[Edit Biber] Formatierung auf gesetzt [/Edit]

Content-Key: 51083

Url: https://administrator.de/contentid/51083

Printed on: April 19, 2024 at 14:04 o'clock

Member: bastla
bastla Feb 08, 2007 at 05:39:35 (UTC)
Goto Top
Hallo wickie666!

Kann ich auf oben genannten code aufsetzen?
Das wird so nicht gehen.

Vielleicht erklärst Du kurz, was Du eigentlich vor hast (ob der Vorgang regelmäßig und vollautomatisch ablaufen soll, und auch, was mit der Ergebnisdatei geschehen soll - werden zB Trennzeichen wie ";" oder "," benötigt, ...). Weiters nicht ganz unwichtig ist der Inhalt der Ausgangsdateien - etwa, ob sie Anführungszeichen enthalten.

Grüße
bastla
Member: Biber
Biber Feb 08, 2007 at 06:01:17 (UTC)
Goto Top
Moin wickie666,

klar kannst Du auf die im anderen Beitrag geposteten Skizzen aufsetzen.
Da sich bis jetzt aber nicht erkennen lässt, was denn genau Dein Plan bzw. der Sinn vons Ganze sein soll, verzichte ich jetzt mal auf jegliche Flexibitität der Lösung und gehe davon aus:
- es existieren im aktuellen Verzeichnis drei Dateien Modules_1.txt, Modules_2.txt, Modules_3.txt
- die Einzelzeilen werden einfach durch ein Leerzeichen getrennt aneinandergereiht
- das gemergete Ergebnis wird auf den Bildschirm ausgegeben - wie Du es in eine Datei umlenken kannst, steht ja im Parallelthread.

::----------snipp Merge3Modules2One.bat
@echo off &setlocal
findstr /n . Modules_1.txt modules_2.txt modules_3.txt|sort /+14>%temp%\input.txt
set "line="  
set /a count=0
FOR /f "tokens=3 delims=:" %%f IN ('type "%temp%\input.txt"') DO call :ProcessLine "%%f"  
if "%line%" NEQ "" (echo %line%)  
del %temp%\input.txt
goto :eof

:ProcessLine
set "line=%line% %~1"  
set /a count+=1
set /a modrest=count%%3
If %modrest%==0 (
    (echo %line:~1%)
    set "Line="  
)   
goto :eof
::----------Merge3Modules2One.bat
Inhalte der Datei Modules_1.txt (Modules_2 und ~_3 ist analog)
Modules_1 erste zeile
Modules_1 zeile zwei
Modules_1 noch eine Zeile
Modules_1 vierte zeile - reicht zum testen
Aufruf am CMD-Prompt:
>Merge3Modules2One.bat
Modules_1 erste zeile Modules_2 erste zeile Modules_3 erste zeile
Modules_1 zeile zwei Modules_2 zeile zwei Modules_3 zeile zwei
Modules_1 noch eine Zeile Modules_2 noch eine Zeile Modules_3 noch eine Zeile
Modules_1 vierte zeile - reicht zum testen Modules_2 vierte zeile - reicht zum testen Modules_3 vierte zeile - reicht zum testen

Den anderen Thread schliesse ich mal und setz ihn auf "gelöst".

Wäre nett, wenn Du erstmal Deinen Plan erläuterst... wieso und woher gibt es denn drei Modules_X.txt mit exakt gleicher Zeilenanzahl und wozu müssen die zusammengemanscht werden? Just for educational purposes?

Gruss
Biber
[Edit] Moin bastla,
sorry hatte Dich nicht gesehen, als ich mit Tippseln anfing...
Aber den tieferen Sinn der Manscherei verstehe ich genausowenig wie Du.. face-wink
[/Edit]
Member: wickie666
wickie666 Feb 08, 2007 at 08:38:26 (UTC)
Goto Top
gerade um den cmd aufruf geht es mir.
Da es immer unterschiedlich viele Zeilen sind (im normalfall mehrere hundert) ist der aufruf nicht wirklich einsatzfähig. geht das auch anders?
Danach behellige ich euch auch nicht mehr face-wink


[Edit]
Die Anwendung ist doch etwas sehr spezielles(wie ihr wohl gemerkt habt). Soll zugeschnitten werden auf eine firmeneigene Software, die ermöglicht gewisse informationen sequentiell in Textdateien auszugeben, nur leider gehören diese Informationen zusammen und eine Art tabellarische Aufstellung wäre nicht verkehrt(es wird in mehrere Textdateien aufgeteilt, da diese auch wieder zur weiterverarbeitung benutzt werden).
Warum das so gemacht wurde? Frag mich nicht... Bin nicht in der entwicklergruppe drin. Und die amis ändern wegen uns nichts ab.
Member: bastla
bastla Feb 08, 2007 at 09:06:45 (UTC)
Goto Top
Hallo wickie666!

Danach behellige ich euch auch nicht mehr face-wink
"Behelligung" ist nicht das Thema (es zwingt mich ja niemand, Dir zu antworten), sondern zB die Frage, ob nicht vielleicht die Verwendung eines anderen Werkzeugs (etwa VBScript) oder ein anderer Lösungsweg (Zusammenfügen in Excel?) vorteilhafter wäre - und natürlich macht's mehr Sinn, nicht auf Verdacht eine Lösung zu entwickeln, die dann aufgrund vorher nicht bekannt(gegeben)er Vorgaben nicht einsetzbar ist.
Anyhow - ein etwas weniger "morgendlicher" Ansatz zu Biber's Vorlage:
@echo off & setlocal
set "in=%temp%\input.txt"  
if exist "%in%" del "%in%"  
set /a FileNr=1000
for %%d in (%*) do call :ProcessFile "%%~d"  
set /a NumberOfFiles=%FileNr%-1000
goto :MergeEm
:ProcessFile
set /a FileNr+=1
set /a LineNr=10000000
for /f "delims=" %%i in ('type %1') do call :outLine "%%i"  
goto :eof
:outLine
set /a LineNr+=1
(echo %LineNr%-%FileNr%:%~1)>>"%in%"  
goto :eof
:MergeEm
set "line="  
set /a count=0
FOR /f "tokens=2 delims=:" %%f IN ('sort "%in%"') DO call :ProcessLine "%%f"  
if "%line%" NEQ "" (echo %line%)  
del "%in%"  
goto :eof
:ProcessLine
set "line=%line% %~1"  
set /a count+=1
set /a modrest=count%%%NumberOfFiles%
If %modrest%==0 (
    (echo %line:~1%)
    set "Line="  
)
Aufruf mit:
Merge.bat M1.txt M2.txt M3.txt > Ergebnis.txt

Grüße
bastla

[Edit] In Zeile for %%d in (%*) do call :ProcessFile "%%~d" ~ ergänzt [/Edit]
Member: wickie666
wickie666 Feb 08, 2007 at 09:22:59 (UTC)
Goto Top
So, jetzt habt ihr es geschafft, ich versteh nix mehr.
Ich kann nicht nachvollziehen, warum bei mir nur eine leere textdatei rauskommt

P.S.:
Mir war schon klar, dass ihr mir gerne antwortet.
Ich hätte übrigens gerne ein VBScript geschrieben, aber unsere SW wird in chemieanlagen eingesetzt und ist somit eine hochkritische Anwendung, mit der restriktive, dass (so gut wie) keine andere Software neben ihr erlaubt wird. Wie die Bibel schon sagt:Du sollst keine anderen Götter neben mir haben.
Member: bastla
bastla Feb 08, 2007 at 09:58:01 (UTC)
Goto Top
Hallo wickie666!

Kleine Änderung in Zeile
for %%d in (%*) do call :ProcessFile "%%~d"  
bereits oben eingearbeitet - wie ist es damit?

Grüße
bastla
Member: wickie666
wickie666 Feb 08, 2007 at 10:06:03 (UTC)
Goto Top
nein, funktioniert leider immer noch nicht.
läuft das Skript denn bei dir korrekt?
Member: bastla
bastla Feb 08, 2007 at 10:14:52 (UTC)
Goto Top
Hallo wickie666!

Bei mir tut's, was es soll (wenn ich gänzlich Ungetestetes poste, vermerke ich das).

Reduziere einfach einmal die erste Zeile auf "setlocal". Damit wird in der Ergebnisdatei jeder Arbeitsschritt angezeigt, bevor er ausgeführt wird (und natürlich auch dessen Ergebnis). Vielleicht nimmst Du zum Testen nur jeweils 10 Zeilen Deiner Testdateien ...

Grüße
bastla
Member: wickie666
wickie666 Feb 08, 2007 at 10:46:19 (UTC)
Goto Top
Ich hab die input datei nicht löschen lassen, hier scheint noch alles i.O.:

10000001-1001:0
10000002-1001:1
10000003-1001:2
10000004-1001:3
10000005-1001:4
10000006-1001:5
10000007-1001:6
10000008-1001:7
10000009-1001:8
10000010-1001:9
10000001-1002:TESTER
10000002-1002:asfj
10000003-1002:asdf
10000004-1002:asdfasfd
10000005-1002:asdf
10000006-1002:asfd
10000007-1002:asdf
10000008-1002:asdf
10000009-1002:asdf
10000010-1002:asfd
10000001-1003:Control Module
10000002-1003:Control Module
10000003-1003:Control Module
10000004-1003:Control Module
10000005-1003:Control Module
10000006-1003:Control Module
10000007-1003:Control Module
10000008-1003:Control Module
10000009-1003:Control Module
10000010-1003:Control Module

Aber trotzdem ein leeres ergebnis.txt

Also als Ergebnis bekomme ich folgendes, wenn ich echo off rausnehme:


C:\Sonstiges\ge>setlocal

C:\Sonstiges\ge>set "in=C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>if exist "C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt" del "C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>set /a FileNr=1000

C:\Sonstiges\ge>for %d in (M1.txt M2.txt M3.txt) do call :ProcessFile "%~d"

C:\Sonstiges\ge>call :ProcessFile "M1.txt"

C:\Sonstiges\ge>set /a FileNr+=1

C:\Sonstiges\ge>set /a LineNr=10000000

C:\Sonstiges\ge>for /F "delims=" %i in ('type "M1.txt"') do call :outLine "%i"

C:\Sonstiges\ge>call :outLine "0"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000001-1001:0 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "1"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000002-1001:1 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "2"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000003-1001:2 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "3"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000004-1001:3 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "4"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000005-1001:4 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "5"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000006-1001:5 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "6"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000007-1001:6 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "7"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000008-1001:7 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "8"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000009-1001:8 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "9"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000010-1001:9 ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :ProcessFile "M2.txt"

C:\Sonstiges\ge>set /a FileNr+=1

C:\Sonstiges\ge>set /a LineNr=10000000

C:\Sonstiges\ge>for /F "delims=" %i in ('type "M2.txt"') do call :outLine "%i"

C:\Sonstiges\ge>call :outLine "TESTER"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000001-1002:TESTER ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asfj"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000002-1002:asfj ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asdf"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000003-1002:asdf ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asdfasfd"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000004-1002:asdfasfd ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asdf"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000005-1002:asdf ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asfd"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000006-1002:asfd ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asdf"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000007-1002:asdf ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asdf"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000008-1002:asdf ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asdf"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000009-1002:asdf ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "asfd"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000010-1002:asfd ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :ProcessFile "M3.txt"

C:\Sonstiges\ge>set /a FileNr+=1

C:\Sonstiges\ge>set /a LineNr=10000000

C:\Sonstiges\ge>for /F "delims=" %i in ('type "M3.txt"') do call :outLine "%i"

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000001-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000002-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000003-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000004-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000005-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000006-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000007-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000008-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000009-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>call :outLine "Control Module"

C:\Sonstiges\ge>set /a LineNr+=1

C:\Sonstiges\ge>(echo 10000010-1003:Control Module ) 1>>"C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>goto :eof

C:\Sonstiges\ge>set /a NumberOfFiles=1003-1000

C:\Sonstiges\ge>goto :MergeEm

C:\Sonstiges\ge>set "line="

C:\Sonstiges\ge>set /a count=0

C:\Sonstiges\ge>FOR /F "tokens=2 delims=:" %f IN ('sort "C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"') DO call :ProcessLine "%f"

C:\Sonstiges\ge>if "" NEQ "" (echo )

C:\Sonstiges\ge>rem del "C:\DOKUME~1\MWIKTO~1\LOKALE~1\Temp\input.txt"

C:\Sonstiges\ge>goto :eof
Member: bastla
bastla Feb 08, 2007 at 13:50:00 (UTC)
Goto Top
Hallo wickie666!

Ich nehme an, Du wirst folgendes Ergebnis spannend finden:
<Z:\>type merge.bat
@echo off & setlocal
set "in=%temp%\input.txt"  
if exist "%in%" del "%in%"  
set /a FileNr=1000
for %%d in (%*) do call :ProcessFile "%%~d"  
set /a NumberOfFiles=%FileNr%-1000
goto :MergeEm
:ProcessFile
set /a FileNr+=1
set /a LineNr=10000000
for /f "delims=" %%i in ('type %1') do call :outLine "%%i"  
goto :eof
:outLine
set /a LineNr+=1
(echo %LineNr%-%FileNr%:%~1)>>"%in%"  
goto :eof
:MergeEm
set "line="  
set /a count=0
FOR /f "tokens=2 delims=:" %%f IN ('sort "%in%"') DO call :ProcessLine "%%f"  
if "%line%" NEQ "" (echo %line%)  
del "%in%"  
goto :eof
:ProcessLine
set "line=%line% %~1"  
set /a count+=1
set /a modrest=count%%%NumberOfFiles%
If %modrest%==0 (
    (echo %line:~1%)
    set "Line="  
)
<Z:\>type M1.txt
0
1
2
3
4
5
6
7
8
9
<Z:\>type M2.txt
TEST
asfj
asdf
asdfasfd
asdf
asfd
asdf
asdf
asdf
asfd
<Z:\>type M3.txt
Control Module
Control Module
Control Module
Control Module
Control Module
Control Module
Control Module
Control Module
Control Module
Control Module
<Z:\>merge.bat M1.txt M2.txt M3.txt
0 TEST Control Module
1 asfj Control Module
2 asdf Control Module
3 asdfasfd Control Module
4 asdf Control Module
5 asfd Control Module
6 asdf Control Module
7 asdf Control Module
8 asdf Control Module
9 asfd Control Module

<Z:\>

Also nächster Versuch - nimm ersatzweise die folgende Zeile rein:
FOR /f "tokens=2 delims=:" %%f IN ('type "%in%" ^|sort') DO call :ProcessLine "%%f"  

Grüße
bastla
Member: wickie666
wickie666 Feb 08, 2007 at 18:10:35 (UTC)
Goto Top
ah, jetzt klappt es! vielen dank!!
Läuft genauso wie ich es haben wollte.

gruß
wickie