I need to use two files in a calculation over about 200000 time steps. The calculation requires that the files contain input data for all time steps, starting at zero. However, I don't have data for the first time steps (from 0 to 40000).
How can I create dummy data, formatted as in the two examples below, to the top parts of my two files, from step 0 to 40000?
Below are examples of what data from one time step look like in each file. What I need to do is copy/paste the data to create dummy data for the first 40000 time steps, only changing the time step and time values as indicated.
File 1.
- The only part that needs to change for each time step are the numbers in i = 39068, time = 19534.000.
- I need the first "i" to be 0 and the first "time" to be 00000.000.
- i/2 = time.
.
260
i = 39068, time = 19534.000, E = -4062.1986631584
Mg -13.3685893531 -3.8172224945 -6.5454328304
Mg -8.0288171797 -9.8589528145 -4.2951766641
Mg -13.5647837790 3.7714741638 11.0518209867
Mg -1.5795350637 4.3136091666 -6.2931048061
Mg -1.3612751052 -7.5574060036 0.1309284910
Mg -15.3370827391 -1.1830156923 -6.7188280399
H -25.9873248868 7.7856564757 -15.3088471263
H -7.7675250833 2.5977735010 28.4575972233
H -9.4734812532 -4.2213295429 14.2412611145
H -3.6844358917 2.2584052865 0.1049152363
O -18.0698975152 2.1776522700 -11.0397875030
O -3.9062250799 4.3450953228 6.0283195565
O -3.5714461764 12.4282336147 -11.6036514440
File 2 format.
- Each row corresponds to one time step. So each row goes with a block of data like in the File 1 example above. E.g., 14.6405230712 14.6405230712 14.6405230712 would correspond to i=39068.
.
14.6405230712 14.6405230712 14.6405230712
14.6404784034 14.6404784034 14.6404784034
14.6404312212 14.6404312212 14.6404312212
14.6356002404 14.6356002404 14.6356002404
If anyone could please point me in the right direction, I would be grateful; I have little experience with Awk, for example. I can't modify the code I'm using to ignore the first time steps because it's pre-compiled.
My tags may not be appropriate and any suggestions there would be welcome too. Also, apologies for the strange formatting with the large spaces and random "." It's the only way I can figure out to display/preserve the formatting for the number columns.