The same is for x2' y2' z2' but must replace x1 y1 z1 with x2 y2 z2, so:
x2'=x2*a11+y2*a12+z2*a13
y2'=x2*a21+y2*a22+z2*a23
z2'=x2*a31+y2*a32+z2*a33
and so on untill the end of file1.
i am new in bash scripting, but i have thought a non-complete solution (because i'm stuck) which would be:
Code:
awk 'BEGIN { #At this point my intention is to save the
getline x < f #different values of file2 into an array of 9
split (x,F) #places, but this is what i can't do.
(and don't know how to go on)
}
{c1=$1*F[1]+$2*F[2]+$3*F[3]
c2=$1*F[4]+$2*F[5]+$3*F[6]
c3=$1*F[7]+$2*F[8]+$3*F[9]
printf "someformat",c1,c2,c3
}' f=file2 file1
perhaps i'm making a serious mistake with my "pseudoscript" but i just wanted to help.
Any other suggestion would be appreciated.
Thanks.
Ezequiel
I have two files. Row id in File1 matches the column id in file2 (starting from column7 )except the last 2 characters. File1 has 50 rows and File 2 has 56 columns. If the id matches I want to multiply the value in column3 of File1 to the entire column in File2. and in the final output print only... (11 Replies)
Hi,
I have 2 ASCII files, say
file1
AAAAA 3.465830E-12
BBBBB 4.263280E-08
CCCCC 1.113320E-17
DDDDD 0.000000E+00
...
file2 with as many lines as file1
3.932350E-12
1.194380E-07
4.901480E-17
0.000000E+00
3.921180E-40 (3 Replies)
Hi,
I have two files (file1.txt, file2.txt) in which, I would like to multiply all the values in file1 with the first row value of file2, file1 * second row value of file2, file1 * third row value of file2 and so on.
Below are my sample data.
file1.txt file2.txt ... (6 Replies)
Hi,
This is something that probably it is more difficult to explain than to do.
I have two files e.g.
FILE1
A15 8.3102E+00 3.2000E-04
A15 8.5688E+00 4.3000E-05
B13 5.1100E-01 1.9960E+00
B16 5.1100E-01 2.3000E-03
B16 8.6770E-01 1.0000E-07
B16 9.8693E-01 3.4000E-05... (4 Replies)
I need to create a large matrix so that I can feed that matrix to MATLAB for processing. The problem is creating that matrix because my data is completely scattered around files.
1. I have one big dictionary file which has words in newlines, like
apple
orange
pineapple
2. I have some... (3 Replies)
Hi ,
I have two files
aaa.txt (which contains)
1 2 3 4 5 6 7 8
9 10 11 12
and bbb.txt (which contains)
-1 -2 -3 -4 -5 -6 5 -8
0 3 0 0
the output that I intended to have is
0 0 0 0 0 0 6 0
4.5 6.5 5.5 6
i.e. Averaging
the script is in the file abc
Begin{START of the... (2 Replies)
Hi,
I have a list of 70 files in a directory and I need to merge the content of each file into one big matrix file (71 columns x 3060 rows).
Each file has the following format only two columns per file:
unique identifier1
randomtext1 randomtext1
a 5
b 3
c 6
d 3
e 2... (11 Replies)