[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-19 Thread Tomas Lycken
OT: I get the code boxes using an extension to Chrome called Markdown Here - it works real well, but it has the disadvantage that you have to manually do the conversion before sending, and I keep forget

[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Steven G. Johnson
On Friday, July 18, 2014 7:12:32 AM UTC-4, Andrei Berceanu wrote: > > Space is an issue, yes, but I agree, I can process them one by one using > some sed scripting. I just thought there is a simple idiom corresponding to > Python's 2-liner above. > Sure, you can do: datastring = replace(reada

Re: [julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Andrei Berceanu
Seems like my files also contained blank lines periodically. I added blank line removal to the sed script and now it all works. Thanks a lot! On Friday, July 18, 2014 2:35:18 PM UTC+2, Mauro wrote: > > on julia0.3 this works: > > julia> readdlm("fl") > 3x3 Array{Float64,2}: > -70.0 -70.0

Re: [julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Mauro
on julia0.3 this works: julia> readdlm("fl") 3x3 Array{Float64,2}: -70.0 -70.0 3.0982e-10 -69.4531 -70.0 2.54816e-10 -68.9063 -70.0 2.23406e-10 julia> readdlm("fl", Float64) 3x3 Array{Float64,2}: -70.0 -70.0 3.0982e-10 -69.4531 -70.0 2.54816e-10 -68.9063 -70.0 2.23406e-1

Re: [julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Andrei Berceanu
Here are a few lines from one of my files, after sed preprocessing: -70.0 -70.0 3.098203380460164E-010 -69.453125000 -70.0 2.548160684589544E-010 -68.90625 -70.0 2.234061987906998E-010 There are

Re: [julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Andrei Berceanu
Here is 1 line from one of my files, after sed-magic: -70.0 -70.0 3.098203380460164E-010 -69.453125000 -70.0 2.548160684589544E-010 -68.90625 -70.0 2.234061987906998E-010 There are 2 spaces at th

Re: [julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Mauro
> Space is an issue, yes, but I agree, I can process them one by one using > some sed scripting. I just thought there is a simple idiom corresponding to > Python's 2-liner above. > In fact, I am wondering, how difficult would it be to make julia accept the > Fortran double precision format nativ

[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Andrei Berceanu
First, thank you both for your time. Space is an issue, yes, but I agree, I can process them one by one using some sed scripting. I just thought there is a simple idiom corresponding to Python's 2-liner above. In fact, I am wondering, how difficult would it be to make julia accept the Fortran d

[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Tomas Lycken
Although you could, probably, do this in pure Julia, is there a reason to not write a small preprocessing script using sed (or your OS’s equivalent) to create altered *copies* of the data before reading it? If HDD space is an issue, you could do this one file at a time using Julia’s run method

[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Tomas Lycken
Although you could, probably, do this in pure Julia, is there a reason to not write a small preprocessing script using `sed` (or your OS's equivalent) to create altered *copies* of the data before reading it? If HDD space is an issue, you could do this one file at a time using Julia's `run` met

[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Andrei Berceanu
I would prefer to keep my original files intact. In Python I can do *import stringimport numpy as nprule = string.maketrans('D', 'E')data = np.loadtxt(fname, usecols=(2,3),\ converters = {2: lambda val: float(val.translate(rule)),\3: lambda

[julia-users] Re: reading data file using fortran's D scientific notation

2014-07-18 Thread Ivar Nesje
If you have a reasonable editor, you should be able to open all your files and issue a global search and replace operation that changes D to E. If you have many files you can use sed to automate the process. kl. 11:41:12 UTC+2 fredag 18. juli 2014 skrev Andrei Berceanu følgende: > > Hi all, > >