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.
Get first line from a file
Name: teognost Date: January 8, 2007 at 05:55:29 Pacific OS: WinXP SP2 CPU/Ram: 700 MHz/640 MB Product: Compaq
Comment:
I need to get from a file only the first line and to write it into other file-only using DOS commands.Till now I have managed to get the entire content of the file using a command like: FOR /F "usebackq tokens=1,* delims=$" %%i in ("file1.txt") do ( echo %%i>>"file2.txt" ) How can I take only the first line and not the whole content? Thanks a lot for any info regarding this issue!
Summary: I'd like to write batch to read the last line (that in this case is a number) of a file log.txt and to assign this value to another variable. I shoud repeat this operation every 10 seconds since the l...
Summary: Hi M2G. But why? > newfile & setLocal EnableDelayedExpansion Only the first word in the first line of the text file is being extracted, delayed expansion is not required (?) and no file is being wri...
Summary: I have a requirment when in i need to get the last N number of line from a file and do a comparision.... can u guide me on how to get the last N lines from a file ...