September 17, 200520 yr Hi, I often need to import text data which includes carraige returns. I use the CSV or TAB systems and of course each time I get in troubles. How can I convert the CR in such a way that they will stay in the required fields? I use Text-Edit and converting CR to Line FEED didn't help especially because I mix Japanese and Latin ecodings therefore I convert everything to UTF-8. I suggestions highly welcome Thanks
September 18, 200520 yr What application exports the files you get? Since the CR denotes the end of record when importing, a CR in an individual field must be substituted with another character. This is usually done by the exporting software. If it's not done, it'll be hassle editing the export file... Assuming you have a file with the CR substituted (say with ~~~), make a script with the Replace Contents to replace any field's ~~~ with a CR.
September 18, 200520 yr Author I use Tex-Edit or Apple Text Edit. I prefer the previous as it allows creating Applescripts very well, while the Apple Editor doesn't even allow to see the invisible chars. However to convert to Unicode is always a problem so I usually do my preparation work with Tex-Edit but I need to paste the files in the Apple Editor as Filemaker doens't understand Unicode properly so I have to paste in an empty document formatted as RTF to than make it plain txt and export as UTF-8. Unicode in UTF-16 from Apple's text editor become garbage in Filemaker. In fact Text edit shows the Carriage returns as "c" tried to change them to n but it didn't help at all Edited September 18, 200520 yr by Guest
Create an account or sign in to comment