Loading CSV file which have new line with blank columns
Hi,
I have CSV file which has a new line in middle of the column and the rest of the data in that row has gone to next line.
because of which i am facing issue while loading the data into DB.
please see the below screen shot.
I need to remove the spaces after column with data "MANJUN" and append the rest of the data after it.
design job as below, tFileInputFullRow----tjavarow---textractDelmitedField---youroutput. in tJavaRow add following code to replace multiple white spaces with one space.
yourcolumn.replaceAll("+", " ");
Note: please make copy of source file before doing test.
Hi Umesh,
I test above code with sample data.It's not removing new line in string.Pls see attached pics.
1st image have sample data.
2nd image talend generated output.
Hi Tulasi,
Use below code in tamp:
row1.Customer_name.replaceAll("\\r\\n|\\r|\\n", " ") (Replace row1.Customer_name with your column)..See attached screen
Hi Kumar.Talend,
Thank you for testing it, but you tested it with wrong data.
As I asked Tulsi earlier, if he show us raw data of file then we can suggest, the images he shared previously showing from excel open view.
he has to open same file in notepad or notepad++ and then locate the problematic row. then take snap and share with us.
Either your file row delimiter is different?
Column has long spaces.
may be Filed delimiter is different?
or anything else.
please share the actual data not the created one, last solution provided to replace multiple white spaces with single one.
Hi Umesh,
I have attached the screen shot of the file. i am attaching i once again.
The screen shot i have attached is the one form the notepad++ only.
The delimited file is tab separated.
Thanks,
Tulasi