CSV iterator does not seem to work with CR (vs CRLF) at end of each line

I have a data file that I receive each week and process with Automise using the CSV iterator. The week of 8/27 (and all previous weeks), the file was processed fine. On 9/3 I received the same file (as far as I could tell), but the CSV iterator indicated that there was only one line in the file and only processed the first line. I tried saving the file with another filename (still as a CSV), but it did not solve anything. Then, in Notepad++, I viewed both files while showing ALL characters, and it indicates that the new file has a CR (carriage return) at the end of each line, while the old file (which processes correctly) has a CRLF (carriage return and line feed) at the end of each line. This seems to be the only difference.

I am not sure how the file is being processed differently, but is there a way for Automise to work correctly with just the CR at the end of each line?

I cannot provide the files themselves, but if you are unable to replicate this issue I can try to create mockups and send those.

Thanks,

Jonathan

Hi Jonathon

I had a look at the code, it’s using the Scripting.FileSystemObject ReadLine function, which does not handle CR line endings. This action is going to need a rewrite to fix this.

CR only line endings are unusual, I think it’s only old mac’s that do this, most unix based OS’s (like linux and OSX) use LF, windows use CRLF.

So I guess the simplest option right now is to replace the CR with CRLF. I have attached a project that shows how to do that (replace CR with CRLF where CR is not followed by a LF).

FixLineEndings.atp5 (1023 Bytes)

I appreciate the answer. This turns out to be an error on the part of the person who saved the file, but this will be a good way to (hopefully) run the batch process anyway, even when they mess up. :slight_smile: