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

I feel, you need to write small code to do this. check echo manpage if you get anything...

info coreutils 'echo invocation'
  • $nilesh