I am having trouble writing a script which will compare two fields in two different lines of all files in a certain directory.
So far I have been able to locate the two fields but do not know how to compare their the two values
this is what I have so far.
for file in "ls *.edi" ; do
grep "ISA" * | cut -f7 -d "*" | cut -f7 -d "|"
grep "GS" * | cut -f3 -d "*" | cut -f3 -d "|"
Now i need to compare these two fields and if they are different echo the filename to the user.
Any help would greatly be appreciated.
Thanks
So far I have been able to locate the two fields but do not know how to compare their the two values
this is what I have so far.
for file in "ls *.edi" ; do
grep "ISA" * | cut -f7 -d "*" | cut -f7 -d "|"
grep "GS" * | cut -f3 -d "*" | cut -f3 -d "|"
Now i need to compare these two fields and if they are different echo the filename to the user.
Any help would greatly be appreciated.
Thanks