![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Append a Value to each line of the file | dsshishya | UNIX for Dummies Questions & Answers | 11 | 03-21-2008 02:48 PM |
| How to append words at the end of first line | lmatlebyane | Shell Programming and Scripting | 11 | 02-28-2008 04:39 AM |
| append a line to the last line in a file | subhrap.das | UNIX Desktop for Dummies Questions & Answers | 5 | 04-25-2007 10:17 AM |
| using sed to append text to the end of each line | Redg | UNIX for Dummies Questions & Answers | 8 | 07-26-2006 11:59 AM |
| Using SED to append character to each line | c0nn0r | Shell Programming and Scripting | 4 | 07-08-2006 10:07 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
append line
dear all,
i am fresh for unix, and currently i wish to insert a line into a txt file as below: test.txt ------ abc def ghi and i wish to insert "hello world" in between abc and def line: output wanted: ------------------ abc hello world def ghi what should be the "sed" use? |
|
||||
|
How do you make the changes permanent in the file. I want to be able to save the changes from the awk command.
i tried the example above, then issued the cat command but the "hello world" wasnt saved to the file. $ cat testfile abc def ghi Also when I try the command with a file called file11 with the following data: Line1 Line2 Line3 I get the following output: Line1hello world Line2Line3 |
|
||||
|
Great thanks. That solved the problem of how to save it.
The other problem that I have is that the output seems to join together whereas I want it inserted in a new line. e.g. file1 with the following data Line1 Line2 Line3 When I check the results in the file it saves to, the output comes out like this: Line1Hello world Line2Line3 Whereas I would like the output to be as follows: Line1 Hello world Line2 Line3 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|