reading files
From: rand (joleg_at_noMAIL.it)
Date: 07/28/04
- Next message: David Frank: "Re: reading files"
- Previous message: Jan Vorbrüggen: "Re: Newbie question: creating dll without the need of CVF 6.6 Runtime library"
- Next in thread: David Frank: "Re: reading files"
- Reply: David Frank: "Re: reading files"
- Reply: David Frank: "Re: reading files"
- Reply: Klaus Wacker: "Re: reading files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jul 2004 11:53:32 +0200
I want to read a matrix in binary form like this:
122334
122333
233233
334455
My purpose is to read the matrix 3 character per times (also 8 or other) and
I do this:
character(3), allocatable :: matrix(:)
....
numbytes=3
irec=0
open(11,file=filename,status='unknown',form='unformatted',access='direct',re
cl=numbytes)
do i=1,numlines
irec=irec+1
read(11,rec=irec) matrix(i)
enddo
For the first line there are not problems. From the second...
matrix(1)=122
matrix(2)=334
matrix(3)=1 <----- because it reads also null characters and return
What can I do?
The problem could be solved reading the file so this:
122334122333233233334455
but this is not a solution.
- Next message: David Frank: "Re: reading files"
- Previous message: Jan Vorbrüggen: "Re: Newbie question: creating dll without the need of CVF 6.6 Runtime library"
- Next in thread: David Frank: "Re: reading files"
- Reply: David Frank: "Re: reading files"
- Reply: David Frank: "Re: reading files"
- Reply: Klaus Wacker: "Re: reading files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]