Re: Fortran write(print) problem



Wang Jun wrote:
When I was processing some data files, there needed many ctl
file(something like .ini),
and they should start every line without any "space".
But when I write some code like:

  write(5,*)'DSET  ^', filenamep
  write(5,*)"OPTIONS little_endian"
  write(5,*)"UNDEF  -999.0"
  write(5,*)"TITLE Rainfall of Tibetean"

in the written file, every line start with a "space":

Yes. You've specified "*" formatting, which means (essentially) that you don't care about the details of how it looks so long as you can read it. Some compilers print out *-formatted lines with spaces in front of them; some don't.


If you do care about the details (such as whether or not the line starts with a space), you need to specify the format in more detail, like so:

   write(5,'(2A)')'DSET  ^', filenamep
   write(5,'(A)')"OPTIONS little_endian"
   write(5,'(A)')"UNDEF  -999.0"
   write(5,'(A)')"TITLE Rainfall of Tibetean"

- Brooks


-- The "bmoses-nospam" address is valid; no unmunging needed. .



Relevant Pages

  • Re: yanks organization is fuckin crazy
    ... without Wang, there would be no playoffs for the yanks, at least for the last 2 seasons. ... why are they punishing their best pitcher last 2 yrs, and arguably the best pitcher in the league in the same time span too. ... care what the guys are paid, I care what they do on the field. ...
    (alt.sports.baseball.ny-yankees)
  • Re: Admin Image AND Network License
    ... But I just let SW take care of it when creating the ... I looked in the .ini and it is as you have it for the port and server ... as well as for the S/N. ...
    (comp.cad.solidworks)
  • Re: INDY WRESTLING EXPOSED
    ... Why the fuck would I care that Harrison Ford is wrestling with his wang out? ...
    (rec.sport.pro-wrestling)