plot using .dat file
1 Attachment(s)
hi!
i need help to plot certain values which i have saved in a .dat file. here is the screenshot of .dat file.. please help!! |
If you just want to remove the text from the file to leave the numbers:
Code:
sed 's/[^ ]*=//g' file.dat |
also WHAT software are you using ?
and what language is it in ? python ? perl ? m( matlab) ? FORTRAN ? or are you using a spreadsheet program ? or just the terminal only and bash scripting it ? i could go on GUESSING!!!!!! but you need to fill in the blanks |
Feed me! Feed me DATA!
Agree with above, you need to feed us enough information for us to understand what you are going to need.
If my program returned a data file like that, with no time stamp or sequence number, I would be ashamed. GNUPLOT could be used to extract and plot data for that format, but it would be slightly ugly. There is no way to reorder the data and reliably maintain any interesting kind of relationships, so the current order must be preserved. From whence came this data? |
for a output like you posted
Libreoffice's Calc will do import it as a CSV and make a graph |
Hi,
If there were only numbers in two distinct columns, it could have been plotted easily with gnuplot at the command line. Provided you have gnuplot, you could do: Code:
$ gnuplot |
@ john VV
I am using geany as IDE. language is C. the values are of four different channels from MCP3208 which give them to pi and pi apply certain features like MAV and RMS etc to these values which are saved in .dat/.csv file. i have to plot them seperately but as they are in same column so gnuplot is taking all of them plotting a single graph which of no use... i have to chnage them into four diffrent columns. i have tried changing loops but vain.... |
then use a spreadsheet
calc ( excel) can do many things -- even play space invaders using the cells |
There is a major problem with
sed 's/[^ ]*=//g' file.dat in that it will remove the space between the columns creating one number for each line. For ex: channels=1 Voltage=1.82 channels=2 Voltage=0.34 would become 11.82 20.34 You would need to either keep the space or replace it with a comma. sed -e 's/^*=//g' -e 's/[ ]*=/,/g' file.dat The above would work if my sed syntax is correct. The first rule matches the newline and removes everything. The second matches the space between columns and replaces it with a comma. You should get 1,1.82 2,0.34 |
From 'info sed'
Quote:
|
All times are GMT -5. The time now is 04:43 PM. |