1.

Solve : add line to .txt file?

Answer»

Been LOOKING all over for some way to do this.

i have a file called "times.txt"

looks like this

Code: [Select]0,0,23.809524
1,1,24.390244
2,4,23.809524
5,5,24.390244
6,7,23.809524
8,8,24.390244
how can i add a line like "First Line"

so that it looks like this

Code: [Select]First Line
0,0,23.809524
1,1,24.390244
2,4,23.809524
5,5,24.390244
6,7,23.809524
8,8,24.390244
the PROGRAM that uses this txt file wont accept it unless it has certain line at the start.
if i could batch do this to the file that is generated to be processed i could FULLY automate my script without adding the lines in myself.


any ideas?
alright:

Code: [Select]echo first line > times2.tmp
type times.txt >> times2.tmp
erase times.txt
ren times2.tmp times.txt


First thing that came to my head. MAKE sure to backup your files in case I screwed up.thanks worked like a dream. didn't think about TEMP files oh I forgot- add

Code: [Select]
erase times2.tmp

to the bottom of that



Discussion

No Comment Found