[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Simon Byrne
It seems like you have a bunch of null characters in the string for some reason. You could try stripping them out with replace: julia> x = "\x002\0.\x005\0" "\x002\0.\x005\0" julia> y = replace(x,"\0","") "2.5" julia> parse(Float64, y) 2.5 On Tuesday, 25 October 2016 05:44:34 UTC+1, Ch

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Chris Stook
I just need a vector of the values. The names are known from the circuit file. The problem is really just with converting the string to a Float64 value when the file is Unicode from LTspiceXVII. Everything works fine with the ASCII from LTspiceIV. More specifically, the capturing block which

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Jeffrey Sarnoff
I got this log file: Circuit: * C:\Users\Jeff\Documents\LTspiceXVII\examples\test.asc Direct Newton iteration for .op point succeeded. current: i(r1)=2.5 Date: Tue Oct 25 03:55:44 2016 Total elapsed time: 0.134 seconds. tnom = 27 temp = 27 method = modified trap totiter = 2091 traniter = 2088

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Chris Stook
The circuit file is test1.asc ( https://github.com/cstook/LTspice.jl/blob/master/test/test1.asc). You should be able to open it with LTspice and run the simulation to produce the log file. The log file is a human readable text file, which I am parsing to get the measurements. LTspiceIV used A

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Jeffrey Sarnoff
I downloaded that software, did you create that log file? If so, how? It is likely that what is being stored in the log file is not a sequence of numbers in a vanilla format. So parsing it as a sequence of strings is not going to work. from their help: OK, that works for bitmaps, but can I

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Chris Stook
The file ( https://github.com/cstook/LTspice.jl/blob/LTspiceXVII_compat/test/test1.log) is a .log file produced by LTspiceXVII ( http://www.linear.com/designtools/software/). I'm using regular expressions to parse the file. The code below shows the problem. io = open("test1.log","r") for line

[julia-users] Re: parse Unicode string to Float64

2016-10-24 Thread Jeffrey Sarnoff
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 i