i have two text files file1.txt
and file2.txt
. Both the files contain same number of rows and columns and i want to divide all rows of file1.txt with file2.txt and my expected output is depicted below.NB: in output file the the string ?-er modes will be replaced by v-er modes
.I hope some expert will help me finding my output.Thanks in advance.
file1.txt
layer 1 s-er modes u = -15.0
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
layer 2 s-er modes u = 0.0
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
layer 3 s-er modes u = 10.0
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
file2.txt
layer 1 m-er modes u = -15.0
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
layer 2 m-er modes u = 0.0
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
layer 3 m-er modes u = 10.0
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
2.98 2.98 2.98 2.98 2.98 2.98
output
layer 1 v-er modes u = -15.0
1.00 1.00 1.00 1.00 1.00 1.00
1.00 1.00 1.00 1.00 1.00 1.00
1.00 1.00 1.00 1.00 1.00 1.00
layer 2 v-er modes u = 0.0
1.00 1.00 1.00 1.00 1.00 1.00
1.00 1.00 1.00 1.00 1.00 1.00
1.00 1.00 1.00 1.00 1.00 1.00
layer 3 v-er modes u = 10.0
1.00 1.00 1.00 1.00 1.00 1.00
1.00 1.00 1.00 1.00 1.00 1.00
1.00 1.00 1.00 1.00 1.00 1.00