We are working with Covisint to deliver various claim files. We recieve files from various vendors and send them to Covisint. The flat files that are pipe delimited with 27 columns. Each row in the file is a message and Covisint expects each row to be terminated with a CR/LF.
The files we are getting in do not all have the correct terminator. Some are CR/LF, some are CR and some are LF. There are even those that will have all CR or all LF except for the last message. The last message won’t have a terminator.
We have a shell script already in place that checks the file for a couple of things, one being that it contains 27 columns. However, I need something that can look at the file to determine if all of the terminators are CR/LF. If not, we are marking the file as bad, sending an email to the vendor to have them send the file according to specs. We DO NOT want to attempt to manipulate the file to change the terminators to the correct ones.
I have tried awk, perl, grep, sed, plus any combination of them to try to get this to work. I tried gawk and dos2unix but our unix server doesn’t recognize those commands.
Any ideas????
Tom Rioux