1.

Solve : Redirecting only a few lines to a file?

Answer»

Hello,

I am trying to use the "cmd" prompt in Windows XP. I am trying to find out if I can redirect only the first few lines of the output APPEARING on my screen to a file?

e.g. ipconfig >> test.txt CAUSES several lines to be written to the file "test.txt".

I am looking for selecting, say the 1st 3 lines to be written to the "test.txt" file or of a way to skip the first few, and then write the next 3 lines

Any ideas, thoughts will be appreciated! Thanks.In this specific case, something like this will work:

Code: [Select]ipconfig | find ". " > test.txt

Unfortunately this is not generic code and applies only in this situation by coding the output DATA instead of the METHOD. Either Powershell or any of the Windows SCRIPTING languages would be more helpful here.

Thanks, Sidewinder for that tip! That works for me, for now!



Discussion

No Comment Found