Author Topic: Odd result reading txt file.  (Read 1587 times)

0 Members and 1 Guest are viewing this topic.

XXL66

  • Newt
  • Posts: 99
Odd result reading txt file.
« 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




VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: Odd result reading txt file.
« Reply #1 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")

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Odd result reading txt file.
« Reply #2 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?



Peter2

  • Swamp Rat
  • Posts: 650
Re: Odd result reading txt file.
« Reply #3 on: May 16, 2019, 04:24:59 PM »
Your file is "UTF-16 LE"; I suppose that this causes the problem.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23