![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Insert 2 lines in a file at a specific location | potro | Shell Programming and Scripting | 2 | 05-08-2008 07:38 PM |
| Remove duplicates from File from specific location | gopikgunda | Shell Programming and Scripting | 1 | 04-09-2008 02:16 AM |
| Insert lines at specific location in file | hcclnoodles | Shell Programming and Scripting | 17 | 03-28-2007 08:00 AM |
| excutable script to copy a file to a different location. | nazehcalil | UNIX for Dummies Questions & Answers | 4 | 12-21-2006 09:17 AM |
| Reading specific contents from a file and appending it to another file | dnicky | Shell Programming and Scripting | 5 | 10-04-2005 05:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Bash copy file contents into an existing file at a specific location
Hi all
I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 File B paragraph 1 paragraph 2 So I would end up with: File A line 1 line 2 paragraph 1 paragraph 2 line 3 line 4 Here's what I have been trying to do: while read line do sed '$POSa\$line' B.txt > A.txt done < B.txt Thanks for the help. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|