While doing some debugging output for use as CSV data, I ran across a limitation that I'm not sure how to get past.
The following program code illustrates the issue.
program test
character*32:: comma_delimited='0123456789abcdefghijklmnopqrstuv'
integer:: i
open(unit=10,file='comma_delimited.txt',status='replace',access='sequential')
write(10,*)(comma_delimited,',',i=1,5)
write(10,90000)(comma_delimited,',',i=1,5)
90000 format(10(a,a))
close(unit=10)
stop
end
What I would expect is to see 5 instances of the string separated by commas, and all in one record. Instead, I see:
0123456789abcdefghijklmnopqrstuv,0123456789abcdefghijklmnopqrstuv,0123456789abcdefghijklmnopqrstuv,0123456789abcdefghij klmnopqrstuv,0123456789abcdefghijklmnopqrstuv, 0123456789abcdefghijklmnopqrstuv,0123456789abcdefghijklmnopqrstuv,0123456789abcdefghijklmnopqrstuv,0123456789abcdefghijklmnopqrstuv,0123456789abcdefghijklmnopqrstuv,
I wonder if there is a way to specify a bigger record length for this type of output. BTW, when I specify a record length (i.e. RECL=256), it fills the first two records out to the new record length with NULL characters and does not 'join' the lines back together. The second line is totally unaffected by using RECL=.
If I use formatted output, there is no issue on record length, and no filling of the remainder of the records with NULL.
Bill