A very naive question... I have a file which has many rows and many columns and I would like to chop off the rows and create a new file per row named after the first column of every row + 1. The data files look like:
etc...
And the new files should look like
File Splotch4_0010_part_b.asc :
Where the _0010_ comes from the first entry, in bold + 1
Hi ,
Just telll me again the new file naming convention i will abck to you in 5 min it is simple one I could not find a word like Splotch ---- part_b in your first column and if i add to 1 with the forst row first column then also i did not get what you write
any way just tell me again
Here is the approach you can start with
say your datafile name is main.data
while read data
do
echo $data > Newfile_name.data ##based on column value this file
done<main.data
it will one row every timer from your main file and create a new file and save the row !
Last edited by jambesh; 08-26-2006 at 05:58 AM..
Reason: spelling mistake
thanks! Now for each data file named "Splotch4_0010_part.asc" I have an additional one containing only the information of the row I looked for with gawk: "Splotch4_0010_part_b.asc"
Now it turns out that I am so silly that I don't know how to tell the script to plot first Splotch4_0010_part.asc and then immediately "Splotch4_0010_part_b.asc"
It must be easy but I am not good at all in scripting... The script looks like
------------------------------------------
---------------------------------
The part containing "plot "< zcat $f | gawk -v NAME=60001 '/AS/ {TIME=$4} $1==NAME {print TIME,$2,$3,$4,$5,$6,$7,$8,$11; exit}'" using 3:4 with points pt 6 lt -1"
should be replaced with "gnuplot please now plot the file Splotch4_0010_part_b.asc before you plot the following one, Splotch4_0011_part.asc"
I know this is a silly question, but since you've been in this story since the beginning and you seem to be good at scripting too, I resort to you
I have not used gnuplot. But tell me one thing - Do you mean to say that in this line -
the first '$f' should be Splotch4_0010_part.asc and the next '$f' should be Splotch4_0010_part_b.asc. Or is it something else.
I wanto to firstly plot the Splotch4_0010_part.asc and then immediately the _b_ corresponding I created thanks to your script, Splotch4_0010_part_b.asc
So that it should be something like
where $f are my files and $g the companion files created with your script
I don't know how to define a second variable in the "for" block
Of course the dark red comment is wrong, but I guess you get the idea
Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file.
Any help would be great
Thanks (6 Replies)
I have 2 files,
file01= 7 columns, row unknown (but few)
file02= 7 columns, row unknown (but many)
now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there
e.g.
file 01
James|0|50|25|10|50|30... (1 Reply)
Dear all,
Please help me ,,,,
if I have input file like this
A_AA960715 leucine-rich repeat-containing protein GO:0006952 defense response P
A_AA960715 leucine-rich repeat-containing protein GO:0008152 metabolic process P
A_AA960715 leucine-rich... (5 Replies)
Hi, I am rather new to Unix/Linus. I have this problem that I would like to solve using unix.
Here is what I have
start stop expression
1 5 15
2 6 10
I want a output like this
position expression
1 15
2 25
3 ... (3 Replies)
Hi Friends,
How to add if data is in different rows.
Input:
1;20091102;20170930;-9.00;|
1;20091026;20170930;-2.00;|
1;20100720;20170930;-25.00;|
1;20090901;20211227;-10.00;|
Output
9+2+25+10 = 46
Thx
Suresh (4 Replies)
Dear unix gurus,
I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this:
adam peter
blah blah blah
blah blah blah
car
01 30 200
02 31 400
03 57 121
.. .. ..
.. .. ..
n y... (8 Replies)
Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)