1

I have a series of data:

columnABC,columnDEF,columnG

I only want column ABC and columnG, is there a way to skip columnsDEF?

   allocate(ABC(1:3,1:N))
   read(1)ABC
   allocate(DEF(1:3,1:N))
   read(1)DEF
   deallocate(DEF)
   allocate(G(N))
   read(1)G

   use ABC and G for calculations

Do I have to allocate and read DEF in order to access G? There has to be a way to skip over these next three without actually populating the allocated array DEF? Or is what I've got pretty standard procedure? Thanks Stack.

Charles
  • 50,943
  • 13
  • 104
  • 142
Griff
  • 2,064
  • 5
  • 31
  • 47

1 Answers1

1

for an unformatted sequential acess read, simply doing read(1) will skip the data record, no need to declare/allocate DEF.

agentp
  • 6,849
  • 2
  • 19
  • 37
  • unformatted sequential access files have header data describing the length of each record. more info here: http://stackoverflow.com/questions/8751185/fortran-unformatted-file-format – agentp Jan 27 '13 at 13:29