![]() |
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 |
| sed query | gopsman | Shell Programming and Scripting | 4 | 02-03-2009 02:41 AM |
| & in SQL query | Lindarella | Shell Programming and Scripting | 3 | 10-09-2006 04:43 PM |
| Query In awk | raguramtgr | UNIX for Dummies Questions & Answers | 1 | 08-27-2004 11:00 AM |
| RPM Query | silvaman | UNIX for Advanced & Expert Users | 1 | 08-15-2003 07:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sed query
I have a series of folders /temp/a /temp/b /temp/c
In folders a, b, and c, I have files a1.txt……….a20.txt b1.txt……….b40.txt & c1.txt……….c60.txt Each file has the same data format :- Line 1 AAAAA aaaa Line 2 BBB bbbbbb Line 3 CCCC cccccc Etc etc I need to write a sed script which will go through all the files and reformat the data thus :- Line 1 AAAAA aaaa Line 2 BBB Line 3 X bbbbbb Line 4 CCCC cccccc Etc etc So I need to insert a CR/LF in line 2 position 4, create a new Line 3 with a constant text (X) and the value of what was to the right of the previous Line 2 (bbbbbb) and move the remaining lines one line down. Can anyone help please ? I don't know sed very well, and awk not at all. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|