I have to develope unix script in such way it should meet below scenario.
I have 3 text files, 1.txt , 2.txt and 3.txt
Data in those files as below.
HDR|1|2|3|||||||||||||||||||||||
DTL|||||||||||||||||||||||||||||||
DTL|||||||||||||||||||||||||||||||
TLR|||||||||||||||||||||||||||||||
For the first file (1.txt
), we have to remove line based on TLR tag.
For the second file (2.txt
), we have to remove lines based on both TLR and HDR.
For the 3rd file (3.txt
), we have to remove line based on HDR tag.
After doing above operation I have to put those three files data into single file.
Here we are not sure how many files we get to merge it.we cannot directly hard code file names (like above 3 text files).
How can we achieve this script?