This is rather odd, your character codes are control codes (0x02 STX, start of text; 0x05 ENQ, enquiry) and really do not belong in a numeric string. Do all the entries use that pattern "\x002\anumber.\x005\bnumber"? If so, and the intended number is anumber.bnumber, there would be a way. What is the file extension on the input file, and do you know what program generated it?
On Tuesday, October 25, 2016 at 12:44:34 AM UTC-4, Chris Stook wrote: > > I'm trying to parse a text file which contains some floating point > numbers. The number 2.5 is represented by the string "\x002\0.\x005\0". > Parse will not convert this to a Float64. Print works (prints "2.5") in > Atom and Jupyter, but not in the REPL. > > _ > _ _ _(_)_ | A fresh approach to technical computing > (_) | (_) (_) | Documentation: http://docs.julialang.org > _ _ _| |_ __ _ | Type "?help" for help. > | | | | | | |/ _` | | > | | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) > _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release > |__/ | x86_64-w64-mingw32 > > julia> print("\x002\0.\x005\0") > �2�.�5� > julia> parse(Float64,"\x002\0.\x005\0") > ERROR: ArgumentError: invalid number format "\x002\0.\x005\0" for Float64 > in parse(::Type{Float64}, ::String) at .\parse.jl:167 > > julia> > > I am not familiar with Unicode. Is the Unicode valid? How should I > convert this to a Float? I do not have control over the input file. > > Thanks, > Chris > >
