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.
Adding Blank lines at start of file
Name: sushilp Date: June 20, 2003 at 04:27:11 Pacific OS: Sun Solaris CPU/Ram: P4/512
Comment:
Hi I want to add 3 blank lines at the start of a file can u help me with the command
Name: nails Date: June 21, 2003 at 11:00:27 Pacific
Reply:
David's is an easy, straightforward solution to this problem.
However, if you'd like to edit the file in place, you can do this:
vi yourfile > /dev/null 2>&1 MSG O
^[ :wq MSG # Uses unix document, need two less than signs before the first MSG. This forum wipes out these characters.
1) "O" opens the first line in vi. 2) Place the required CRs 3) Press the ESC key. Emulate the ESC key in vi by pressing control-v, and then hitting ESC. 4) vi quits with :wq
Regards,
Nails
0
Response Number 3
Name: Dlonra Date: June 23, 2003 at 08:32:29 Pacific
Reply:
i prefer ex instead of vi for scripting ex yourfile MSG 0i
Summary: i am simply trying to search a file for a specific line, and then duplicate that line immediately after the original - and print the entire file out to another file. it seems like it should be so simp...
Summary: Hi I have file which has the foll format 1+---------+ data data End of line +----------+ The above pattern is repeated several times How do i remove the blank lines between "End of line " and "+----...
Summary: The solution depends where you want to insert the date in your file. On a single line at end of file : echo `date` >> /path/to/file After the string 'validated on ' sed "s!\(validated on \)!\1`da...