WRITE, FORMAT problem



Hello everybody

I have a problem with the formatting of a write statement.
I am manipulating large data arrays (matrices) and I try to write out
the data as being semicolon separated. Since the array dimensions are
input, the format statement can not be hard coded.


I tried (n_rows and n_columns are input):

do i=1,n_rows,1
do j=1, n_columns,1
write(unit=201,fmt="(<2*n_columns>a)"), &
trim(adjustl(arr_data(i,j))), char(59)
end do
end do

and I get as result

[Loadcase ID];
Time Step;
XTP;
YTP;
ZTP;
XTS;
YTS;
ZTS;
XBP;
YBP;
....

But what I want as a result is

[Loadcase ID];Time Step;XTP;YTP;ZTP;XTS;YTS;ZTS;XBP;YBP;...
....


I tried several other ways but either they did not compile or the
result was not what I wanted
[This does not work either:
write(unit=201,fmt="(<n_columns>(a, char(59)))"), &
trim(adjustl((arr_data(i,j), j=1,n_columns,1), i=1,n_rows_hea,1))]


Maybe somebody can help me. Thanks in advance for your help,
regards Alex

.



Relevant Pages

  • Re: WRITE, FORMAT problem
    ... I have a problem with the formatting of a write statement. ... I am manipulating large data arrays and I try to write out ... I tried several other ways but either they did not compile or the ...
    (comp.lang.fortran)
  • Re: Alternatives to VBA in Excel
    ... I do not dare to put some hundreds loc into this message. ... which can do quite a lot of formatting and manipulating the Excels sheets ...
    (microsoft.public.excel.programming)