Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Name: Holla Date: January 26, 2009 at 21:42:26 Pacific
Reply:
If there wont be a zero, you can do this. pseudo code:
For every line in the file ( Set /a expr=line-from-file if expr == 0 (output the line to numbers.file) else (output the line to text.file) ) find out line counts of both files, example - for /f "delims=: tokens=2" %%a in ('find /c /v "" numbers.file') do set numbercount=%%a Similarly find lines of the text file.
Now, for /l %I in (1,1,smaller of the line count) do ( for /f "skip=%I" .... and read Ith line from both the file and output to target file. Go out of this for loop after processing Ith line. )
-- Holla.
0
Response Number 2
Name: Huzefa Date: January 27, 2009 at 00:07:39 Pacific
Reply:
Fortunately it does have a same string in the beginning. type 2.txt | findstr /i /n "Name:" >> 2a1.txt type 2.txt | findstr /i /n "Age:" >> 2b.txt type 2a1.txt | sort /+17 >> 2a.txt for /f "tokens=1-2 delims=]" %%a in ('type 2a.txt') do (echo %%a]%%b >> file.txt) && (type 2b.txt | findstr /i "\%%a]" >>file.txt)
Summary: Hello, I'm trying to create a script that sorts a text file(~25mb) for redundant entries. Currently I have it working - with a massive array, the input text file is over 2.5 million lines. It works as...
Summary: If the lines consist of more than line numbers you will need a initial pass to extract the number field, or use a sort routine that can sort by fields. Sample Program Results is for a list of 100,000...
Summary: I don't know whether Perl is right or wrong. It just that I have nearly 30 years of DOS or DOS-like program experience and more than 30 years of BASIC experience. This is what I would do. 1 - sort th...