I have a fortran program that uses data from file.dat. I'm trying to write an awk script that will update values in file.dat and then run then the fortran program, loop style.
Say file.dat is
1.0 2.0
3.0 4.0
5.0 6.0
7 8
9 10
I need the script to run the fortran program with these value, then increase the first 4 values, run the program again, increment the first 4 values, run program, etc, about 100 000 times.
My problem is actually getting file.dat to be updated, which seems like it shouldn't be a problem, but I'm blanking.
I've got the rest of it running, albeit mighty ugly-like, I'm sure. I have 4 while loops (4 loops, since i need to go through all the permutations of the first 4 fields). I chunked the file into 2 records, NR=1 being the top four values, NR=2 being the rest, but I'm not sure that was a good idea.
I can try writing the data to a new file (or files & then combining them), but since my fortran call is in the loop, it seems like the new values get appended instead of replacing the old data.
Any suggestions?
Say file.dat is
1.0 2.0
3.0 4.0
5.0 6.0
7 8
9 10
I need the script to run the fortran program with these value, then increase the first 4 values, run the program again, increment the first 4 values, run program, etc, about 100 000 times.
My problem is actually getting file.dat to be updated, which seems like it shouldn't be a problem, but I'm blanking.
I've got the rest of it running, albeit mighty ugly-like, I'm sure. I have 4 while loops (4 loops, since i need to go through all the permutations of the first 4 fields). I chunked the file into 2 records, NR=1 being the top four values, NR=2 being the rest, but I'm not sure that was a good idea.
I can try writing the data to a new file (or files & then combining them), but since my fortran call is in the loop, it seems like the new values get appended instead of replacing the old data.
Any suggestions?