hl7 - Copy and paste to new file, maintain LF vs CR? -


i'm using emeditor manually split large files (3gb+). spent hour doing before realizing thew new files had carriage returns old files had line feeds , carriage returns.

these hl7 files, kind of important...

how can maintain special characters on copy/paste?

if losing lf characters going on assumption file generated windows system , has been brought on , modified/manipulated in unix based system. have run in issue between these 2 platforms windows reads new line crlf , unix looks cr, indicated above.

i have had success in automating file move/manipulation processes between 2 platforms, , crlf issue specifically, using perl script adds lf on @ end of every line. conversion can go both ways, , write on how leverage perl (as other methods solve exact problem) located here: https://kb.iu.edu/d/acux

specifically, can download perl install www.perl.org (it's free) , run following code, calling out script should run in perl specifically:

perl -p -e 's/\n/\r\n/' < unixfile.txt > winfile.txt

in context of windows system, create .bat file above code, create windows task automate .bat, , set appropriate "start in" directory file conversions going take place. according code above, read in file called unixfile.txt, add in crlf characters every line contains cr, , spit out new file called winfile.txt formatted crlf on each line.

if struggling still or if having trouble part of suggested feel free let me know. have done few file conversions windows system receiving unix file , i've had success automating conversion , delivering file, hope find helpful!


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -