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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[tos 7] Read ascii file and split into several parts according specific character

Hi all,

 

I have many asciil files  with this format:

*NAME toto1
28 9 2016 23 59 59 9397.25
29 9 2016 23 59 59 84324.43
30 9 2016 23 59 59 45183.76
1 10 2016 23 59 59 17872.50
2 10 2016 23 59 59 64405.49

*NAME toto2
28 9 2016 23 59 59 0.00000
29 9 2016 23 59 59 0.00000
30 9 2016 23 59 59 0.00000
1 10 2016 23 59 59 0.00000
2 10 2016 23 59 59 0.00000
3 10 2016 23 59 59 11191.57232
4 10 2016 23 59 59 0.00000
5 10 2016 23 59 59 0.00000

 

I would like to get this output result

Name;date;value

toto1;28/09/2016;9397.25

toto1;29/09/2016;84324.43

toto2;28/09/2016;0

toto2;29/09/2016;0

 

How to do with Talend ? Which components ?

How to detect "*" character ?

FYI, nb of rows per name can be different

 

Thank you

Labels (2)
4 Replies
fdenis
Master
Master

you have t use tmap
row1.data.left(1).equals("*") may solve your detection problem
use ao local variable may solve the rest.


but first thing to do may be a tutorial to understood the logical of Talend and it's components…
Anonymous
Not applicable
Author

Thank for your reply

I use  your solution 0683p000009M9p6.pngtringHandling.LEFT(row1.line,1).equals("*")  in filter condition into Tmap component (output)

But it distinct only rows and i would like to get all next rows (number can be different) until I retreive a row beginning by *

 

Thank you

fdenis
Master
Master

you have to store the value into tmap (midle part).
add something like that into var1
(tringHandling.LEFT(row1.line,1).equals("*") )?row1.line:var1.var
it's inline if (condition)?ifTrue:ifFalse
Anonymous
Not applicable
Author

Finally, I use a Tjava component and not a Tmap