UniversalDataReader and files with Linux end of line

Hi everyone!

I need to import a txt file with Linux end of line.

I used UniversalDataReader to import the file but when I run the graph it crashes with the following error:

org.jetel.exception.BadDataFormatException: Parsing error: Unexpected default field delimiter, probably record has too many fields. in field # 23 of record # 1, value: ‘<Raw record data is not available, please turn on verbose mode.>’
at org.jetel.data.parser.DataParser.parsingErrorFound(DataParser.java:530)
at org.jetel.data.parser.DataParser.parseNext(DataParser.java:436)
at org.jetel.data.parser.DataParser.getNext(DataParser.java:169)
at org.jetel.util.MultiFileReader.getNext(MultiFileReader.java:321)
at org.jetel.component.DataReader.execute(DataReader.java:217)
at org.jetel.graph.Node.run(Node.java:390)
at java.lang.Thread.run(Unknown Source)

If I import the same file with Windows end of line everything works!

How can I solve this issue?

Hello,
you have to set proper recordDelimiter on metadata: \n for Linux and \r\n for Windows. To make your graph working with both, Linux and Windows, ends of line you can use alternative delimiter feature: \n\\|\r\n

Hello,
you have to set proper recordDelimiter on metadata: \n for Linux and \r\n for Windows. To make your graph working with both, Linux and Windows, ends of line you can use alternative delimiter feature: \n\\|\r\n

“avackova”

Thanks for your help.

I tried your solution on the metadata linked to the edge that links the UniversalDataReader with another component without success.

What is your default field delimiter? Can you show metadata?

What is your default field delimiter? Can you show metadata?

“avackova”

I solved the problem.
I’ve created the metadata from a similar file with a different end of file and so I couldn’t import the original file.
Thanks for your help.