Quote:
Originally Posted by
sunnykamal59
Hi Chublar,
Thank you!My requirement is to pick and process the latest file received in past 3 days, which has 'SAMPLE' in position 31 on line 19 and than grep 'GENERIC' in the file and copying it to other file.
Instead of appending the 'GENERIC' text from all the files.Can we just only process the latest file which has 'SAMPLE' ?
operating system is windows 7 32 bit.
shell: /bin/bash
.dat file is : fixed width
We still do not have any clear description of what you are trying to do!
We now know that each of your
.dat files has the same number of bytes, but we have no idea how to determine where line 19 in that file starts or ends. And, even if we did know how to identify the line boundaries on the 1st 19 lines, which file you want to process is not clear either.
Do you want to process the latest file? Or, do you want to process the latest file only if that file that contains
SAMPLE (which has now apparently changed from
S A M P L E) starting at character position 31 on line 19? Or, do you want to process the latest file that contains
SAMPLE or
S A M P L E on line 19 starting at character position 31, and also contains at least once occurrence of
GENERIC?