Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Non-visible characters in first line of an ascii file
#1
When I open a sequential ascii file using ReadLine, I experienced that the first line's string is proceeded by two non-visble characters (namely hex BB BF). Is there any simple way to get rid of these characters? Let me add that you may trace these characters if you use a get to string with starting value 1 (not 0). Any advice is welcome.

Function ReadSeqFile
Code:
Copy      Help
str sRec="$my qm$\Files\Test_Seq.txt"
File f.Open(sRec "r")
str s
f.ReadLine(s)
out s
str sg.get(s 0 3)
out sg
sg.get(s 1 3)
out sg
sg.get(s 2 3)
out sg
sg.get(s 5 3)
out sg
#2
File.Open and other QM functions don't remove byte-order-mark (BOM).

Macro Macro2757
Code:
Copy      Help
if(s.beg("[0xef][0xbb][0xbf]"))
,out "UTF-8"
,s.remove(0 3)
out s
#3
Many thanks indeed!


Forum Jump:


Users browsing this thread: 1 Guest(s)