Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.


Thanks,
Tulasi
Labels (4)
25 Replies
Anonymous
Not applicable
Author

Not able to see the attached. please upload it again. or you can attached the same line(including split) as file to the post.
Anonymous
Not applicable
Author

Hi Tulasi,

Did you get any login issue? We saw that you posted your issue as "Guest".

Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Umesh,
Sorry for the inconvenience,Please find attached the screen shot.
0683p000009MCdw.jpg
Anonymous
Not applicable
Author

Hi Tulsi, 
By looking at your file i am unable to find what is the problem, but I would like to suggest that use below code to replace multiple Tab spaces, e. g. if your line contains more than 1 tabs then replace with {2} if it contains more than that then use multiple replace statements on same line. check for below solution. 
String foo = "bar	1		2			3";
System.out.println(foo.replaceAll("\\t{2}"," ").replaceAll("\\t{2}"," "));

or you can use below statement regardless of Tab, space, empty value & new line as well. 
System.out.println(foo.replaceAll("\\s+","	"));

hope this will work for you..
Anonymous
Not applicable
Author

Hi Umesh,
Where should i use this code.
Currently i am using it in tjavaRow.
The actual problem is the row that i have showed here is a single line and due to the tabs spaces the row got split into 2 line and the number field is taking the string field in the second row and the issue For Input String : "MANJUNATH" is displayed. as shown in the screen shot.
Anonymous
Not applicable
Author

try below flow 
tFileInputFullRow--tJavaRow--tMap--tExtractDelimitedField---yourOutput. 
you will get "line" column in tFileInputFullRow. 
use mention code in tJavaRow 
output_row.line=input_row.line.replaceAll("\\s+","	");

rest of the things need to modify as per requirement.