I am trying to add a line of text just before the last line in a file.
For example, if the last line of a file is "exit 0", I need to add a line of text just before that.
Any ideas how I might do that?
Thanks (5 Replies)
Hi I need to add a comment line at the begining of a text file. The scenario is given below.
1. The number of servers that needs to be updated is around 80
2. The location of the text file in all the servers are the same including the file name.
3. The comment has to be added at the very... (2 Replies)
Hi,
I wanted to add specific text to each row in a text file containing three rows. Example:
0 8 7 6 5 5
7 8 9 0 7 9
7 8 9 0 1 2
And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this:
21 0 8 7 6 5 5
7 8... (4 Replies)
Dear Folks :),
I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp.
I can do this in vi editor by using this command :g/^/s//BBB_
e,g I have a file named as Test.dat and it containins below text:
michal... (4 Replies)
Hi,
Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11
Thanks for your help. (6 Replies)
I've been playing with sed, trying to get it to insert the contents of somefile.txt after line 13 on anotherfile.txt. I tried searching for a line with regex and attempting to insert something on the next line with:
find ./anotherfile.txt -type f -exec sed -i -e '/^dog/cat/' {} \;
but it... (2 Replies)
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)