I have several files Log.100 Log.200,Log.300 .... which are in an array
Log.100 file contains the data
gpg RC (54321)
Testion option OK
Local=IN
AIX.SHA1.So
and Log.200 file and other files contains data
gpg RC (54321)
Testion option OK
Linux.SHA1.so
All files misses the line 'Local=IN' except Log.100. So I want to copy the line Local=IN and then paste it in all the remaining files after the line 'Testing option OK'.
Note:- When I read the files by an array, I am not sure which file i.e (Log.100, Log.200,or Log.300 I will be reading first)
All the Log files are in a one single directory.
My plan was to use grep command in the perl script and traverse each file through an array and whenever it finds that line copy and save it in a variable and again traverse all the files and paste the variable value after the line 'Testion Option OK' in all the files.
Kindly provide the code.
your help will be appreciated
Thanks
Log.100 file contains the data
gpg RC (54321)
Testion option OK
Local=IN
AIX.SHA1.So
and Log.200 file and other files contains data
gpg RC (54321)
Testion option OK
Linux.SHA1.so
All files misses the line 'Local=IN' except Log.100. So I want to copy the line Local=IN and then paste it in all the remaining files after the line 'Testing option OK'.
Note:- When I read the files by an array, I am not sure which file i.e (Log.100, Log.200,or Log.300 I will be reading first)
All the Log files are in a one single directory.
My plan was to use grep command in the perl script and traverse each file through an array and whenever it finds that line copy and save it in a variable and again traverse all the files and paste the variable value after the line 'Testion Option OK' in all the files.
Kindly provide the code.
your help will be appreciated
Thanks
Comment