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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

multiple row separator in text file

Hi
I'm having text file like this

CN=100
adshnxhndxghdngfhdsfs
dsjfxnudshxf hfgdsh
ldnf jsdbf hdsbf


IN=200
jhnxrhewxrgewhgxew
ejxn jehwbf ewhfbew
jdksfn sbfhb hfe

XN=300
jskhd sa
jd jhgdsxbfgsdhbfgeh
kdsnbdhfhdgfhdbfhd

IN=400
jhnxrhewxrgewhgxew
ejxn jehwbf ewhfbew
jdksfn sbfhb hfe

XN=500
jhnxrhewxrgewhgxew
ejxn jehwbf ewhfbew
jdksfn sbfhb hfe

In above file, CN= and XN= are my field separator. More can be there, Its just an example. But row separator can be found in this format only like I have mentioned. CN= or XN= etc

I need to store data after every row separator in different file. 
From this file I should be getting five output files. That would be great if I could get row separator value in file as well.

Any suggestion ?

Thanks

Labels (2)
4 Replies
Anonymous
Not applicable
Author

Any suggestion please ?
Anonymous
Not applicable
Author

Most likely need to process it in code, using a tJavaFlex component, process row by row, detect your own separators and open/close output files accordingly
JR1
Creator III
Creator III

If there will always be one (and exactly one) empty line between two sets of data, you should try to use "\n\n" as your row separator and "=" as your field separator. The first field will then hold "XN" or "IN" and the second one the rest with all the other values which you will then be able to write in a file. The first line will then be the number after the "=". Let us know how this works out for you.
Anonymous
Not applicable
Author

according to me, the easier is :
firstly replace separators by  uniq separator
seconthly split the file with a tfileoutput (aech row = 1 file)