[resolved] how to replace in a field when the row separator is also
Hello,
I have a delimited file (field separator "\t", row separator "\n") looking like :
1
\tblue
\tapple
\n 2
\tred
\n \tpeer
\n tFileInputDelimited will fail on line 2 ...
So my idea was to replace the row separator so I will be able to replace \n by "" in the field. Bbut I didn't found a component for that
Well this format is really big shit
. Well, still there is solution of course 🙂 If you know the schema, you can go trough the whole file and detect \t char which seems to be used as column delimiter and repair the file first before it can be read by Talend.
Send me the file to archenroot@gmail.com, I can write small code which will standardize the file.
Ladislav
your example shows line terminators as \t\n or \t\0\n. First replace all the \t\0\n with \t\n then pass to the tFileInputDelimited with a \t\n row separator.
no sorry, in the screenshot there's not all the examples. Some lines do have a value in the last column. So the end of line can be : string\n or string\t\0\n or string\t\n
If you don't give us the correct info we can't give you a correct solution. Can you get the data fields surrounded by quotes? Then you'd be able to treat is as a csv file.