Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Help with FileReader and writer (http://www.mirthcorp.com/community/forums/showthread.php?t=219087)

Mits87 04-12-2019 02:00 PM

Help with FileReader and writer
 
2 Attachment(s)
I am receiving a text file. The first three lines of the file are patient information and after that, it contains the patient test result which is tab delimited (/t). I need to save the patient information from the top and then delete the first 3 lines and save the file as is.

I created one file reader and was able to store the first three line values in a variable for later use but it's not deleting the line 2. In addition to that, it's also removing /n after each line and in the output file, it saves the entire file as a single line instead of keeping the file as is. I need the file as is in the tab-delimited format after deleting the top three lines.

Can someone point out my mistake? I did try to play around with set data type options under summery but no luck so far.

I am using 3.7.0. Please see the attached channel and the sample test file.

lbittle 04-12-2019 08:04 PM

Suggest that you might find it easier to do this with a shell script and then run that script from the channel.

I would use either the sed or awk commands in the script.

Mits87 04-12-2019 09:54 PM

This is windows environment running windows 10.

schillert 04-15-2019 06:41 AM

1 Attachment(s)
Hi,

this should do it.

Mits87 04-15-2019 10:59 PM

You are awesome works perfectly. The only question I have is I use encoding as Default for the file but you used ISO-8859-15 can you explain why and how to determine which to use.

schillert 04-17-2019 01:18 AM

If you use default encoding Mirth will use the charset the java vm is running with. Under Linux this is mostly UTF-8 - under Windows this is most likely Windows 1272(in western Europe).
Choosing a charset depends on the encoding of your messages - in Germany this is nearly always ISO-8859-15.
So if you know the charset of your messages - that's the one to use.

Mits87 04-17-2019 09:57 PM

Thanks for the explanation. I think this will help me a lot in the future.


All times are GMT -8. The time now is 12:21 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation