Search the file with some content and insert the row after that and write some other thing

22 views Asked by At

I want to edit the file in the following way

My Sample File:

101 273970116 2719674681506161941D094101METABANK               WAVECREST                      
5220Taxi Charger    Micro Deposit - Cr  A271967468WEBP2P             150616   1273970110000001
6220110000156534057672       0000000007GreenGrP2C386daTest User             S 0273970110000001
6220110000156534057672       0000000005ClarkGrP2C386dcTest User             S 0273970110000002
82200000020002200002000000000000000000000012A271967468                         273970110000001
9000001000001000000020002200002000000000000000000000012                                       
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

In the above file, wherever if i find the row starting with number '6' , i need to insert the line after that row and write some thing as

ex : 798R03073972187779351      05190376011000015                                   044000024265158

Finally my output file should be as below:

101 273970116 2719674681506161941D094101METABANK               WAVECREST                      
5220Taxi Charger    Micro Deposit - Cr  A271967468WEBP2P             150616   1273970110000001
6220110000156534057672       0000000007ClarkGrP2C386daTest User             S 0273970110000001
798R03073972187779351      05190376011000015                                   044000024265158
6220110000156534057672       0000000005ClarkGrP2C386dcTest User             S 0273970110000002
798R03073972187779351      05190376011000015                                   044000024265158
82200000020002200002000000000000000000000012A271967468                         273970110000001
9000001000001000000020002200002000000000000000000000012                                       
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

Can someone please help me to get the solution for this. ?

Regards, Saidivya

0

There are 0 answers