Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
KarimBen
Contributor II
Contributor II

Get specific line of txt file

Hello, 

I merged some txt files, now I need a certain line from a certain file. I hope you can help me.
From this file I need the #Statistics line with all values ​​separated by '|'

2022-04-07 18_56_48-QNAP-MPS und 3 weitere Seiten - Geschäftlich – Microsoft​ Edge.png

2022-04-07 19_00_10-.png 

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

Hi, 

maybe one solution to extract the Statistics values might be:

 

MarcoWedel_0-1649505809738.png

 

tabStatistics:
Load File,
     SubField(SubField(TextLine,'#Statistics:',2),'|') as Values
Inline [
File TextLine
File1 -1#901,1,2,3,4,5|6,7,8,9|10,11,12,13
File1 -1#901,11,12,13,14,15|16,17,18,19|110,111,112,113
File1 -1#901,21,22,23,24,25|26,27,28,29|210,211,212,213
File1 #Statistics:12345|23456|34567|45678
File2 -1#901,1,2,3,4,5|6,7,8,9|10,11,12,13
File2 -1#901,11,12,13,14,15|16,17,18,19|110,111,112,113
File2 -1#901,21,22,23,24,25|26,27,28,29|210,211,212,213
File2 #Statistics:98765|87654|76543|65432
File3 -1#901,1,2,3,4,5|6,7,8,9|10,11,12,13
File3 -1#901,11,12,13,14,15|16,17,18,19|110,111,112,113
File3 -1#901,21,22,23,24,25|26,27,28,29|210,211,212,213
File3 #Statistics:11111|22222|33333|44444
] (delimiter is spaces)
Where TextLine like '#Statistics:*';

 

hope this helps

Marco

View solution in original post

1 Reply
MarcoWedel

Hi, 

maybe one solution to extract the Statistics values might be:

 

MarcoWedel_0-1649505809738.png

 

tabStatistics:
Load File,
     SubField(SubField(TextLine,'#Statistics:',2),'|') as Values
Inline [
File TextLine
File1 -1#901,1,2,3,4,5|6,7,8,9|10,11,12,13
File1 -1#901,11,12,13,14,15|16,17,18,19|110,111,112,113
File1 -1#901,21,22,23,24,25|26,27,28,29|210,211,212,213
File1 #Statistics:12345|23456|34567|45678
File2 -1#901,1,2,3,4,5|6,7,8,9|10,11,12,13
File2 -1#901,11,12,13,14,15|16,17,18,19|110,111,112,113
File2 -1#901,21,22,23,24,25|26,27,28,29|210,211,212,213
File2 #Statistics:98765|87654|76543|65432
File3 -1#901,1,2,3,4,5|6,7,8,9|10,11,12,13
File3 -1#901,11,12,13,14,15|16,17,18,19|110,111,112,113
File3 -1#901,21,22,23,24,25|26,27,28,29|210,211,212,213
File3 #Statistics:11111|22222|33333|44444
] (delimiter is spaces)
Where TextLine like '#Statistics:*';

 

hope this helps

Marco