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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AJ151
Contributor
Contributor

Reading lines between two strings in a file

Hello everyone,

I want to read lines between two particular strings in a file.

Eg : AAA 34567 5678

BBB HFDT ₹556

CCC YU UKK45

BBB YUHJ IOKH

DDD​ UUU IHJK

The order may keep changing but I need all the lines starting from CCC till

DDD.

Is​ it possible in talend? Could you please help with it.

Note: The data is only in file format..

Iam new to talend. Kindly help with this. ​

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

My idea is to get the line number of lines that starts with 'CCC ' and' 'DDD' respectively, and then to read the lines between the range of line_number1 to line_number2 using tSampleRow, see

0693p000009HZBuAAO.png0693p000009HZBpAAO.png

0693p000009HZBzAAO.png

0693p000009HZC4AAO.png

In your case, use tFileInputFullRow instead of tFixdFlowInput to read the file line by line. Please try and let me know if you have any questions.

 

Hope it gives you hints!

 

Regards

Shong

 

View solution in original post

1 Reply
Anonymous
Not applicable

Hi

My idea is to get the line number of lines that starts with 'CCC ' and' 'DDD' respectively, and then to read the lines between the range of line_number1 to line_number2 using tSampleRow, see

0693p000009HZBuAAO.png0693p000009HZBpAAO.png

0693p000009HZBzAAO.png

0693p000009HZC4AAO.png

In your case, use tFileInputFullRow instead of tFixdFlowInput to read the file line by line. Please try and let me know if you have any questions.

 

Hope it gives you hints!

 

Regards

Shong