![]() |
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 |
| 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 !! |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
SED again...
hi could u tell me how to use sed for the following issue:
i have 2 files A and B . A has say 100lines: line1 line2 line3 . . . line100 i want to read data from file A and save it in file B as : line1, line2, line3, ... line99, line100 that is in a single line. What is the best way to do this...i thought of using the sed command sed -i '1,$s/$/" parameter "/' fileB but cudnt get how to read the text from fileA and pass it as a paramete to the Sed command? |
|
||||
|
Quote:
Code:
sed -n -e :a -e 'N;s/\n/, /;$p;b a' fileA > fileB |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|