Originally Posted by josephkram54
here is a sample file. There would be multiple files together but I need to do a find on ZZ*xxxxxxx and then print out in same format the lines beginning with ISA and ending in IEA that contain the initial string. I would then reprocess those files through our system. I am looking for a script that I could run .
ISA*00* *00* *ZZ*xxxxxxx *01*001317452L *131016*0634*X*0200 *000030794*
You've posted sample data that doesn't contain what you're looking for??? The only string that has ZZ..... in it is above, but doesn't terminate with IEA. Again, can you post a sample of what you're actually looking for, and a sample of what you want to get OUT? There were several other questions in my first reply which you haven't answered either. Again, without details, there's not much we can help with.
A short hint would be to run the input file through grep for "ZZ*", which will pull out all the lines with ZZ* in them. From there, your script could read that input file, to see if the beginning/ending is what you're after. Can you also post what you've written/tried so far?