I have a relatively easy question i suppose for which, however, until now i could not find a solution.
I am working with a program that will give me an output file similar to the following:
As the file is rather long and may variy in length for different files
i need to convert it to the following form:
so that ich can use gnuplot.
So far i have only found solutions for cases like:
to
done with awk.
I sadly am not very familiar with awk or sed commands but i can at least make them work in a simple bash script.
I was hoping for a solution that would do for 1 file something similar to wenn i would have 2 files
Is there any decent solution for this problem that i could use ?
Notice that the number of lines below A might vary in length.
So far i could only think of somehow scanning from the beginning to the first empty line, then write a file A.dat, continue scanning from this empty line (since B has in reality a similar value to A) to the next line, write B.dat and so on.
Then in the end i could paste all those files togehter in a bashscript, still i would not know how to script something like
I appologize for the long description. I am not used to using forums for questions but i really would appreciate some help or
tips for tutorials that might prove helpful for this kind of problem.
Alternatively it would of course also be appropriate if it was possible to plot
this format with gnuplot directly though i doubt that.
I just noticed on more thing.
Despite awk doing what it should.
For two values
i have an input like
However upon using
Those 2 lines are (together with its values 1 2 3 4) not written to the new file. They are somehow skipped.
How come awk is ignoring lines with 0.000 ?
Since as is changed it manualy to 0.000001 it works (i'd like not to do this manually though every time, despite the fact that i need the line with 0.000)
Last edited by Franklin52; 03-05-2014 at 12:18 PM..
Reason: Please use code tags
This does indeed work for the zeros, those are now correctly printed.
However the rest of the values have now all doubled.
I tried it also on an example:
now becomes
How to avoid that ?
It may now be relevant to the question but how
can i for example add a minus in front of the lower half of the values eg:
Please only answer this one as you see it appropriate.
Last edited by Franklin52; 03-05-2014 at 06:56 PM..
Reason: Please use code tags
Hi Folks,
I am using db2 command -> db2 list tablespace show detail
Tablespace ID = 10
Name = TSCDDHLMSUM
Type = Database managed space
Contents = All permanent data.... (5 Replies)
Sorry if I repost my question in this section, but I'm really in a hurry since I have to finish my work... :(
Dear community,
I have a table with two rows like:
Row1 Row2
======= =======
7,3 text 1
1,3 text 2
1,2,3 blabla
What i need to do is add/copy... (2 Replies)
I have a text file with the geneIds separated by space in each line. The number Ids in lines are different.
The file is like:
abc qwe tyu ghj jkl dfg sdf
cvb sdk fgh tyu
uio iop tyu rty eru wer rty iop
asd sdf dfg fgh zxc
I want to format the file like:
abc
qwe
tyu
ghj
jkl
... (7 Replies)
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 Replies)
Hello,
I have an input file like the following:
11_3_4
2_1_35
3_15__
_16989
Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Hi there,
I've an input file1 as follows:
1001
1002
1003
1004
1005
I would like to have an output file2 as follows:
Numbers are 1001/ 1002/ 1003/ 1004/ 1005/
Any help is appreciated. (2 Replies)
Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)