c read an arbitrary file of columns of data. If there are characters in a line c other than number,commas,periods or minus signs then the line is c interpreted as a comment line. Data sets are dileneated by comment lines. c Each row of data appears in array column(19). Here we read two files c and write out the difference of the last data sets in each. character*59 first,second character*264 string real column(19),value(19,1000,2) c do ifile=1,2 ifile=1 if(ifile.eq.1)call strget(' first file ?',first) c if(ifile.eq.2)call strget(' second file ?',first) type 3 3 format(' Which columns for x and y ?',$) read(5,4)ix,iy 4 format(2i) idata=0 open(unit=1,file=first,readonly,type='OLD') 10 read(1,1,end=99)string c write(6,1)string 1 format(a132) call com_or_data(string,id) !id=0 for comment line, 1 for data if(id.eq.0)then open(unit=13,file='new_'//first,type='new') c write(13,1)string !comment line, write it out and read next idata=0 !comment line indicates new data set goto 10 endif if(id.eq.1)then !data idata=idata+1 !row of data call data_line(string,ncolumns,column) do j=1,ncolumns value(j,idata,ifile)=column(j) end do endif 2 format(1x,7e9.4) c type 2,(column(j),j=1,ncolumns) goto 10 99 continue c end do !ifile do i=1,idata write(13,5)value(ix,i,1),value(iy,i,1) 5 format(1x,2e12.3) end do !i end