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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
ptromblee
Contributor
Contributor

[resolved] Swap Data in text file

Hi,

 I have a text file that I need to change some data in. The file is x12 formatted file but there is only one segment where I need to move the data. This is a sample of one of the lines:

W01*1*EA*111101001985*VN*C4041C 058A P042 S*29.50*29.50**1**0.00*106480002




I need to swap 111101001985 and 106480002. This line is just delimited by an *.  I can't just read it in as a delimited file as there are other lines in the file that have different formatted text. But any lines that start with W01 I want to do this with.
I think I could do it by using tFileInputRaw and connect that with tjavarow. I'm just not sure the code to put in. Then the other lines I would just write back out to the text file as is.
Any help would be appreciated.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi 
You can use tFileInputFullRow to read the file line by line, and then filter the lines that starts with " W01" and process these lines.
tFileInputFullRow--main--tFilterRow--main--....
                                                   --reject--...
BRS
Shong

View solution in original post

2 Replies
Anonymous
Not applicable

Hi 
You can use tFileInputFullRow to read the file line by line, and then filter the lines that starts with " W01" and process these lines.
tFileInputFullRow--main--tFilterRow--main--....
                                                   --reject--...
BRS
Shong
ptromblee
Contributor
Contributor
Author

Thanks. That helped me get the issue solved.