Quote:
Originally Posted by naren123.k
i tried this as i am new to this anyways, can you tell me how to extract "s" "r" from trace files into filename.dat for plotting graphs??
|
Sorry, but you can't formulate a question.
The thread name is misleading - in reality you seem have at least two problems:
- not reading the documentation;
- not knowing what parsing is.
I am still waiting for an answer regarding all capital letters in GNUPLOT. And if not yet, you need to understand from 'gnuplot' documentation which formats are understood by 'gnuplot'.
Regarding the second item - I do not know what part of the information from the attached text file you need to plot, which part of the information is supposed to be used as X axis values and which - as Y axis values.
General info on parsing:
http://en.wikipedia.org/wiki/Parsing ->
http://en.wikipedia.org/wiki/Lexical_analysis - probably lexical analysis is more important in your case.
In simple practical cases the 'cut' utility might suffice - read
man 1 cut
.
You might need to run 'cut' a number of times. You might also need 'paste' utility in order to combine columns in separate files into columns in a single file:
man 1 paste
.
For more complex parsing you might need 'awk' (I am not an 'awk' user) - look up on the web
awk tutorial
.
'awk' also can produce the needed output, i.e. to me it looks that with 'awk' you won't need 'paste' (and maybe you won't need 'paste' even with 'cut').
I prefer to use Perl for my parsing and text processing needs - if you are to learn Perl, a good place to start from is
http://perldoc.perl.org/ ->
http://perldoc.perl.org/index-overview.html ,
http://perldoc.perl.org/index-tutorials.html ,
http://perldoc.perl.org/index-faq.html .
And also read
man perl
- to begin with.
Perl takes longer to learn though.