TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: XXL66 on May 16, 2019, 10:55:48 AM

Title: Odd result reading txt file.
Post by: XXL66 on May 16, 2019, 10:55:48 AM
hi,

I have this attached TXT file i want to process using LISP read-line function but i get odd results.

"˙ūP\000o\000i\000n\000t\000 \000I\000D\000,\000E\000a\000s\000t\000i\000n\000g\000,\000N\000o\000r\000t\000h\000i\000n\000g\000,\000E\000l\000e\000v\000a\000t\000i\000o\000n\000,\000F\000e\000a\000t\000u\000r\000e\000 \000C\000o\000d\000e\000,\000D\000e\000s\000c\000r\000i\000p\000t\000i\000o\000n\000 \0001\000,\000D\000e\000s\000c\000r\000i\000p\000t\000i\000o\000n\000 \0002\000\015\000"

however when viewing the file with notepad it seems normal. Does this have to do with ansi or unicode format?

thank you



Title: Re: Odd result reading txt file.
Post by: VovKa on May 16, 2019, 11:05:13 AM
https://www.theswamp.org/index.php?topic=39617.0
Code: [Select]
(vk_ReadTextStream "test1.csv" "utf-16")
Title: Re: Odd result reading txt file.
Post by: rkmcswain on May 16, 2019, 02:53:12 PM
See the results here when I open it in a different ASCII editor (foreground)
The background is the result of opening it in Notepad, Copying to the Clipboard, then Pasting it into this editor.
I wonder if you can just make that quick edit to the file and use it normally?


(https://i.imgur.com/mB8mOdy.png)
Title: Re: Odd result reading txt file.
Post by: Peter2 on May 16, 2019, 04:24:59 PM
Your file is "UTF-16 LE"; I suppose that this causes the problem.