CSV-tab converter

Started by Mark Barkey, November 08, 2016, 11:18:15 PM

Previous topic - Next topic

Mark Barkey


       Program csvtab


c
c      M. E. Barkey
c      23 October 2016
c      This program converts comma to tab delimitted.
c
c





       Real a, b, olda
      Character*8  lc1
      Character*11 lc2
      Character*13 lc3
      Integer i, j, nofiles, fl, newl
      Character*80 filename, fullname
      character*90 outfile
      character*90 prefix

   

     
      open (16, file = 'numfiles.dat')
      read(16,*) nofiles
      close(16)
     
     
      open (15, file = 'filelist.dat')
     
      do 500 j = 1, nofiles
     
      read (15,*) filename
     
      outfile = trim(filename) // '.xls'
     
     
      fullname = trim(filename)
     
      fl = len(fullname)
     
      newl = fl -4
      prefix = trim(fullname(1:newl))
      outfile = trim(prefix) // '.xls'
     
     
      write (*,*) 'Processing: ', prefix, outfile
       
     
     
     

     
     
     
     
     
   
      open (12, file = outfile)


       open (14, file = filename, status = 'old')

       
       
       
       
       
        read (14, *) lc1, lc2, lc3
C        write (*,*) lc1, lc2, lc3
       
        do 100 i = 1, 1000000
       
        read (14, *) a, b
C        write(*,*) a,b
       

       
       
       
        if (olda.eq.a) then
        go to 300
        end if
   
        write (12,*) a, char(9), b
        olda = a
       
       
       
100 continue       
       
300    continue       
       
close(12)
close (14)

500    continue


stop

900   format (a8, a11, a13)

       End