I am trying to read data from files as:
test_50rg0_shear0.01_fric0.5.dat
test_50rg1_shear0.01_fric0.5.dat
test_50rg2_shear0.01_fric0.5.dat
in a Fortran code and then use the data of the second column. My code is
do i=0,2
write(filename_i,'(a,i1,a)')'../test_50rg',i,'_shear0.01_fric0.5.dat
write(filename_o,'(a,i1,a)')'../dist_50rg',i,'_shear0.01_fric0.5.dat'
call system("awk '{print $2}' filename_i > filename_o")
.......
end do
for this I am getting error:
awk: cmd. line:1: fatal: cannot open file `filename_i' for reading (No such file or directory)
Please tell me why there is such error and any other method to do the job.