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.
echo text to specific line in file
Name: remda Date: January 11, 2005 at 13:10:05 Pacific OS: winxp command promt CPU/Ram: 512
Comment:
Hi ! I Im trying to add some text to a txt file like this: echo blablabla >>mu.txt But I dont want the text to be added in the beginning of the file. I want to add the text to a specific line in the txt file..how can I do that?
Name: dtech10 Date: January 11, 2005 at 13:15:50 Pacific
Reply:
Hi Do you want to add a new line of text between the existing lines and at a certain line number or what. Will the text contain "<" or ">" as this may cause some problems.
0
Response Number 2
Name: remda Date: January 11, 2005 at 13:24:12 Pacific
Reply:
Hi
What im trying to do is adding text to a txt file using the echo command in the dos promt. For example, if the txt file contain this text: hiui d gigi <-- on this line I want to add some text didi oo aaa
Is it possible using echo in cmd?
0
Response Number 3
Name: dtech10 Date: January 11, 2005 at 13:37:13 Pacific
Reply:
Hi It's not possible from a command line you are only able to create a new file or append to an existing one. ie echo "text" > File (New File created) echo "Text" >> File (Append to existing File")
What you need is a batch file, do you need to add the line at the same line number every time or doe's this change.
0
Response Number 4
Name: remda Date: January 11, 2005 at 13:46:34 Pacific
Reply:
ok, thanks for the info.. I just wanted to know if it was possible. I think that there would be no use to create a batch file as I am limited to use cmd with parameters.. like this: cmd.exe /k echo "text" >>File
0
Response Number 5
Name: remda Date: January 11, 2005 at 13:50:01 Pacific
Reply:
The line would be at the same line number every time yes.
0
Response Number 6
Name: dtech10 Date: January 11, 2005 at 15:36:22 Pacific
Reply:
Hi will the text be just one word or more and do you require the quotes. What will the line number be.
Summary: I want to be able to read a specific line from a file in C++. I currently have a program that goes like this: char name[20]; int main(int argc, char *argv[]) { cout << "Please enter your name: "; ofs...
Summary: #!/bin/ksh # add to text to end of a file using sed sed 's/$/Add Text to end"/g' myfile # using awk awk ' { print $0"Add Text to end" } ' myfile ...
Summary: hi, is there any way to find a specific line in a txt/ini/inf file, alter that line from the batch file and save the edited file? example: the file blabla.ini contains this line somewhere: DefaultFOV=...