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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
BA621858188
Creator
Creator

Scenario where need to ignore the last line from pipe delimited file

Hi All,

 

I am getting 6 rows in my target file as the source has 6 rows, but when I open the file, I see 7 rows, with the last row coming in as blank because the previous row has a new line character.

 

Can you help to avoid this issue so that we do not get a blank line 7?

Labels (3)
15 Replies
BA621858188
Creator
Creator
Author

@Shicong Hong​ , @Xiaodi Shi​  Do you have any idea on this?

Anonymous
Not applicable

Which components do you use in the job? Go to check if there is an option 'Skip empty rows' on the input components.

 

Regards

Shong

BA621858188
Creator
Creator
Author

@Shicong Hong​  My input is database table(tdbinput) and target is file delimited file(tfileoutputdelimited) and there si no option in tfileoutput component.

Anonymous
Not applicable

try to remove the new line character on a tMap before writing the data to file.

eg:

row1.columnName.contains("\r\n")?row1.columnName.replace("\r\n",""):row1.columnName

 

//\r\n is the new line character on Windows.

 

BA621858188
Creator
Creator
Author

@Shicong Hong​ ,

 

Thank you for your reply. but what will be the column name in this case because for me that entire line is coming up as blank? I need to do this for the last line. can you help with the design?

 

currently the design is as below:

 

tdbinput------------> tfileoutputdelimited

BA621858188
Creator
Creator
Author

@Shicong Hong​ ,

 

source is sending the records correctly but file is generating one blank row at the end which is the issue here.

Anonymous
Not applicable

@Vrushabh Malbari​ , I am not sure if it is a development issue, I need to check with our developers. I want to ask, why do you care about this newline character? Do you need to do further processing with this file?

BA621858188
Creator
Creator
Author

@Shicong Hong​ ,

Yes, Its going via some ETL script further where it is failing while extracting the data from the file. 

BA621858188
Creator
Creator
Author

@Shicong Hong​ ,

 

can you please check and help here?