cobrix icon indicating copy to clipboard operation
cobrix copied to clipboard

US ASCII file with newline character present within data

Open anu17011993 opened this issue 1 year ago • 1 comments

I have a US ASCII file with new line character \n occuring inside data (not actual line sep), the actual line separator is \r\n for this file. Hence when I try to read this file with US ASCII options the data spills over to the next row.

Sample Data

1111 AAA XXXX 090923900 RER\nDFT 1021 2222 AAA XXYY 234902930 RFTSDASD 1221

When I read the file with Cobrix library ASCII options the data looks like

1111 AAA XXXX 090923900 RER DFT 1021 2222 AAA XXYY 234902930 RFTSDASD 1221

Do we have any option in cobrix to solve this problem, may be something similar to multiline in csv reader?

anu17011993 avatar Jan 02 '24 14:01 anu17011993

Hi, @anu17011993 .

Thanks for the question!

Both \n and \r\n are supported as line ending characters automatically when the input format is .option("record_format", "D").

Let me know if that helped. And if not, please specify the code snipped you are using to read the file.

yruslan avatar Jan 02 '24 14:01 yruslan