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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tjavaFlex set

Hi, 

 

Could someone help me set up the tjavaFlex component? I have a txt file and need to delete certain rows(those that contain a string="Page" followed  by a number (Page 1, Page 2, Pge 3....)

 

i have set it up like this but it is not working.

 

thank you in adevance!

Labels (2)
3 Replies
Anonymous
Not applicable
Author

The tJavaFlex works in 3 different phases. When the subjob starts, the "Start Code" section fires once. When the subjob finishes, the "End Code" section fires once. The "Main Code" section is fired for every row that is sent to it.

 

What your code will do is append every row and then carry out the replcement at the end of the subjob just before it prints it to the console. This would work, but you are using the wrong code to reference your input data. Instead of "input.line" you want to use "row1.line". 

Anonymous
Not applicable
Author

Thank you for the reply.

unfortunately it doesn't work even with the row1.line modification.and actually i don;t think this would help as i want to append all the rows until the "seite" string comes up.

i think the problem with my component is at the End code section, the replaceAll arguments.

i need to identify all the rows that contain " Seite 1", "Seite 2,  "Seite 3" and so on.

Anonymous
Not applicable
Author

Yes, you need to experiment with this component I think. As I said, the "Start Code" is run once at the beginning of the subjob and the "End Code" is run once at the end of the subjob. Consider the "Main Code" to be a code block which is run for every row between the "Start Code" and "End Code". You can actually create rows by opening a loop (for or while) in the "Start Code" and closing it in the "End Code"....but that is not what you want to do here.

 

What you need to do is treat every row individually in the "Main Code" section.