Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read/write row over 80 characters ????

Status
Not open for further replies.

galileo1972

Technical User
Feb 17, 2003
14
DE
HI

what can i do if i have a list of DATA´s in one row that ist larger then 80 characters. I have this problem now !!

I have an output of data which are larger then the 80 characters in one row!!! if the end of row is reached, the list continues in the second row (BUT THATS the PROBLEM). Following output, e.g.

13131312 2345241243 254252542 23521351252 21525125 2525
2152 25215

but this should be all in one row !!!!

Later in my program i must read this file. But how can i tell my programm that my row is larger then 80 characters.

cheers


PS: thats my write command (the variables are only example)

write(10,*) a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s

if this is over 80 characters the last two or three variables are written in the next row !!!, thats the failure

and all this should be in one row, because later i must read it in that way:

read(10,*) a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s
 
How do you open the output file?

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Hi

I do open it unformatted.

read(10,*) ..........

Maybe i must write it out formatted, and read it formatted, but HOW ??

do you have an idea ?
 
sorry i forgot something !

i open it without any special "effects" :)

only open(10,file)

i know that is the problem, but what is the solution !!

thanx in advance
 
Try opening the file explicitly with RECL specified before writing to it, something like

OPEN(10,FILE='tmp.dat',RECL=132)

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
hi

it doesnt work

the error message sounds like this:

lio: unformatted io not allowed !!!

galileo
 
This worked for me using Compaq Visual Fortran

program t4
character*80 fn
integer*4 i1/111111111/,i2/222222222/

open(10,FILE='fort.10',RECL=132)
write (10,*) i1,i2,i1,i2,i1,i2,i1,i2,i1,i2

end

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top