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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
husibilski
Contributor
Contributor

Stop reading CSV file at empty row

Hello,

I'm a Talend and Java newbie. I need your help for the following problem.

 

I have to read a CSV file, that has 2 parts:

part1

part1

part1

            <---- empty row

part2

part2

part2

 

Part2 will grow extremly and I need only part1. Can this be solved in Talend or is it better to use Powershell to prepare the data before?

 

Sorry, but my English is very poor.

 

Thanks

 

Labels (4)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Hi,

You can easily ignore the records after an empty has been detected, but you can't stop the reading process.

To do that, set a global variable (lets say "Continue" for example) to True as soon an empty record is detected (using tJavaRow) and in a tMap, add a filter expression to the output flow to ignore the record if the global is True:

(Boolean)globalMap.get("Continue")

Hope this helps.

View solution in original post

2 Replies
TRF
Champion II
Champion II

Hi,

You can easily ignore the records after an empty has been detected, but you can't stop the reading process.

To do that, set a global variable (lets say "Continue" for example) to True as soon an empty record is detected (using tJavaRow) and in a tMap, add a filter expression to the output flow to ignore the record if the global is True:

(Boolean)globalMap.get("Continue")

Hope this helps.

husibilski
Contributor
Contributor
Author

Thanks,

will use awk, the file can be very very very large.

regs