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.
three lines from txt into a var
Name: sami-bami Date: February 26, 2004 at 15:14:23 Pacific OS: 98 CPU/Ram: 128
Comment:
hello.
how can i make my batch to take line 3-5 (from a text file) and put it into one variable ???
so when i will [echo %var%] i will see the three lines just like the text file.
Name: dtech10 Date: February 27, 2004 at 08:38:39 Pacific
Reply:
Hi I don't know of a way to get carriage line+linefeed into an environment variable. you could put them into 3 variables using a third party program called change with is an old PC magizine utility I have which changes text within a text file. Then you could then echo the 3 variables to the screen.
Another way is to use find /n which puts a line number before the lines ie.
[3] text [4] text [5] text
and create a batch file to echo these to a seperate file and type "type filename" instead of "echo %Var%". again you could delete the line numbers useng the change utilty above or leave them in.
You may be able to find the Change file on the net, it not I'll sent you a copy.
Summary: The following script (that needs Win NT/2K/XP) works as you like; to run it type Count #_of_lines File_In File_Out If you set File_Out to CON, it displays the output onto your screen. If the number of...
Summary: Hi. What I'm trying to do is to append the number of lines from a file to a variable. The file's lines would have only one character (and always the same character: "]"). Just that. ie: ::txt.txt ] ]...
Summary: Hello i need to import variable from a text file. to import a line, delete the last character and put it into a variable. type info.txt | find "operat" > temp.tmp and here to enter the line from the...