3
$\begingroup$

I have the below txt file and I want to import it in mathematica, to kick the headers and keep a neat 2 column table or matrix for ploting.

Since I am new in mathematica I have trouble with finding the way to do it.

If you have any suggestions I would be grateful.

Thank you!

LECROYMAUI,0,Waveform
Segments,1,SegmentSize,253
Segment,TrigTime,TimeSinceSegment1
"#1,24-Oct-2017 09:46:30,0"
Time,Ampl
0,-85.0822
1192.09,-81.8994
2384.19,-83.4981
3576.28,-85.526
4768.37,-86.9433
5960.47,-87.5171
7152.56,-88.7014
8344.65,-89.5351
9536.74,-91.1045
10728.8,-92.1466
11920.9,-91.3006
$\endgroup$
4
$\begingroup$

One possibility

SetDirectory[NotebookDirectory[]];
data=Import["input.txt","CSV"];

Now pull the numeric data out

data=Cases[data,{x_?NumericQ,y_?NumericQ}:>{x,y}])  

Mathematica graphics

ListLinePlot[data,Mesh->Full,MeshStyle->Red,Frame->True,
    FrameLabel->{{"y(x)",None},{"x","My data"}},
    GridLines->Automatic,GridLinesStyle->LightGray,BaseStyle->14]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.