As mention it's not json,but more a key/value kind of data.
Then can write a example that fit's this data fine which is a dictionary.
1 2 3 4 5 6 7 8 |
d = {}
with open ( '2.txt' ) as f:
for line in f:
line = line.split()
if line = = [ 'amp' ]:
d[ 'amp' ] = None
else :
d[line[ 0 ]] = line[ 1 ].replace( '"' , '')
|
A look at some data in dictionary,bye slicing out some values.
1 2 3 4 5 6 7 8 9 10 |
>>> import itertools
>>> dict (itertools.islice(d.items(), 0 , 8 ))
{ 'BaseGain' : '70' ,
'Channel1' : '1' ,
'Channel2' : '1' ,
'Delay' : '0' ,
'Freq' : '5' ,
'Name' : 'sanitycheck' ,
'Range' : '6' ,
'TransmissionMode' : 'PE' }
|
Quote:The idea is then to plot this data on a simple x-y graph on MATLAB (via excel through a lot of copy and pasting at the moment).
Python has strong tools for this,that's can replace MATLAB and Excel.
Here a quick demo with plot of some of your data(
islice(d.items(), 60, 80)
) using
Matplotlib and
Jupyter Notebook.
Also look at
Pandas that can do same stuff as Excel,
and also easy to transport to Excel
df.read_excel()
and
df.to_excel()
.