Hi Unix experts
I have simple text files in which the number of lines vary from one file to another. They look like the following:
#
#
.
.
34 46
76 72
39 68
I want to grab the first number of the last line of each file (let's say A= 39 in the above example), which is always a multiplication of 3, and insert a new line in the 28th line of another text file with the following format:
0, (A/3) +1, 0, 3,6,9,12,15,...,A
Where A can be a number between 3 and 54, so the number of fields in the line would be variable. Positions of zeros(0) in the line remain fixed. In case of A=39 the line lools like:
0, 14, 0,3,6,9,12,15,18,21,24,27,30,33,36,39
Any help is very much appreciated.
Regards