The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command nee to cut the record sreenusola UNIX for Advanced & Expert Users 6 08-28-2008 06:11 PM
fl command - set record length Tom Siegel Shell Programming and Scripting 2 07-17-2006 09:50 AM
sql insert command abey Shell Programming and Scripting 2 05-19-2006 11:56 AM
How to insert a record in fixed width flatfile limou Shell Programming and Scripting 1 03-13-2006 03:55 PM
awk command for INSERT statement nattynatty Shell Programming and Scripting 4 05-10-2002 02:11 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-16-2008
Registered User
 

Join Date: Oct 2008
Posts: 22
command to insert a record at a particular loaction

Hi,

Is there any command to insert a line in between two lines?

My input data is as below:
1|ETG|63121387883|Alternate|Y
3|79.58|||GBP||
4|001137001
4|0011372
5|1021701
5|1021901
1|ETG|63121387884|Alternate|Y
3|79.58|||GBP||
4|001137001
5|1021702
5|1021802
1|ETG|63128363077|Alternate|Y
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
2|FR_GB||Electrogalvanize 0.5 m2 ( Renault )
3|88.51|||GBP||
4|001137001
4|001137002
5|1021901
5|7040500
1|ETG|63128363078|Alternate|Y
3|88.51|||GBP||
4|001137001
5|1021702
5|1021722
1|ETG|63128363079|Alternate|Y
2|EN_GB||Electrogalvanize
4|001137005
5|2021901
5|8040500

I need to insert a record (2|||) only in between thoes records marked in red

My desired output is as below :
1|ETG|63121387883|Alternate|Y
2|||
3|79.58|||GBP||
4|001137001
4|0011372
5|1021701
5|1021901
1|ETG|63121387884|Alternate|Y
2|||
3|79.58|||GBP||
4|001137001
5|1021702
5|1021802
1|ETG|63128363077|Alternate|Y
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
2|FR_GB||Electrogalvanize 0.5 m2 ( Renault )
3|88.51|||GBP||
4|001137001
4|001137002
5|1021901
5|7040500
1|ETG|63128363078|Alternate|Y
2|||
3|88.51|||GBP||
4|001137001
5|1021702
5|1021722
1|ETG|63128363079|Alternate|Y
2|EN_GB||Electrogalvanize
4|001137005
5|2021901
5|8040500

can any one help me in this regard?

Thanks in advance
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-17-2008
ynilesh's Avatar
Registered User
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
I feel, you need to write small code to do this. check echo manpage if you get anything...
Code:
info coreutils ’echo invocation’
- $nilesh
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 10:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66