I would like to read data from an ascii file that is in the following
(tecplot) format:
TITLE = "Tecplot DataFile : vg_VolTs_Tecplot_plasma_1.dat"
VARIABLES = "x"
"EMwave_HzReal(A/m)"
"EMwave_Eimag_1(V/m)"
ZONE T="Extracted Points"
STRANDID=0, SOLUTIONTIME=0
I=184, J=1, K=1, ZONETYPE=Ordered
DATAPACKING=BLOCK
DT=(SINGLE SINGLE SINGLE )
2.673771381E-01 5.378874540E-01 8.083977699E-01 1.078908086E+00
1.349418521E+00
1.619928837E+00 1.890439153E+00 2.160949469E+00 2.431459904E+00
2.701970100E+00
2.972480536E+00 ..... this is part of three sequences of 184 numbers
each.
I can think of a brute force approach (read, see what was read, and
proceed, with some kind of state machine), but is there a package that
may make this easier (other than cl-ppcre, which I know of and love)
Thanks,
Mirko
Mirko wrote:
> I would like to read data from an ascii file that is in the following
> (tecplot) format:
>
> TITLE = "Tecplot DataFile : vg_VolTs_Tecplot_plasma_1.dat"
> VARIABLES = "x"
> "EMwave_HzReal(A/m)"
> "EMwave_Eimag_1(V/m)"
> ZONE T="Extracted Points"
> STRANDID=0, SOLUTIONTIME=0
> I=184, J=1, K=1, ZONETYPE=Ordered
> DATAPACKING=BLOCK
> DT=(SINGLE SINGLE SINGLE )
> 2.673771381E-01 5.378874540E-01 8.083977699E-01 1.078908086E+00
> 1.349418521E+00
> 1.619928837E+00 1.890439153E+00 2.160949469E+00 2.431459904E+00
> 2.701970100E+00
> 2.972480536E+00 ..... this is part of three sequences of 184 numbers
> each.
>
> I can think of a brute force approach (read, see what was read, and
> proceed, with some kind of state machine), but is there a package that
> may make this easier (other than cl-ppcre, which I know of and love)
>
> Thanks,
>
> Mirko
Back in the day, I think I had a parser for this in some other language
to remain unnamed. I just wrote a lisp parser for a very similar file,
the LabVIEW measurement data file. I ended up basically writing a
recursive descent parser. That is probably your best bet. It shouldn't
be that hard and the file specification is public and documented.
http://download.tecplot.com/docs/360/dataformat.pdf
Hope that helps,
Tom
On Jul 13, 3:35 pm, "Thomas M. Hermann" <··········@gmail.com> wrote:
> Mirko wrote:
> > I would like to read data from an ascii file that is in the following
> > (tecplot) format:
>
> > TITLE = "Tecplot DataFile : vg_VolTs_Tecplot_plasma_1.dat"
> > VARIABLES = "x"
> > "EMwave_HzReal(A/m)"
> > "EMwave_Eimag_1(V/m)"
> > ZONE T="Extracted Points"
> > STRANDID=0, SOLUTIONTIME=0
> > I=184, J=1, K=1, ZONETYPE=Ordered
> > DATAPACKING=BLOCK
> > DT=(SINGLE SINGLE SINGLE )
> > 2.673771381E-01 5.378874540E-01 8.083977699E-01 1.078908086E+00
> > 1.349418521E+00
> > 1.619928837E+00 1.890439153E+00 2.160949469E+00 2.431459904E+00
> > 2.701970100E+00
> > 2.972480536E+00 ..... this is part of three sequences of 184 numbers
> > each.
>
> > I can think of a brute force approach (read, see what was read, and
> > proceed, with some kind of state machine), but is there a package that
> > may make this easier (other than cl-ppcre, which I know of and love)
>
> > Thanks,
>
> > Mirko
>
> Back in the day, I think I had a parser for this in some other language
> to remain unnamed. I just wrote a lisp parser for a very similar file,
> the LabVIEW measurement data file. I ended up basically writing a
> recursive descent parser. That is probably your best bet. It shouldn't
> be that hard and the file specification is public and documented.
>
> http://download.tecplot.com/docs/360/dataformat.pdf
>
> Hope that helps,
>
> Tom
Yes, I should have mentioned it that I do have access to the
dataformat file that you quoted.
Thanks,