Re: Fortran write(print) problem
- From: Brooks Moses <bmoses-nospam@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 27 Aug 2005 00:53:29 -0700
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. .
- Follow-Ups:
- Re: Fortran write(print) problem
- From: Richard E Maine
- Re: Fortran write(print) problem
- References:
- Fortran write(print) problem
- From: Wang Jun
- Fortran write(print) problem
- Prev by Date: Fortran write(print) problem
- Next by Date: Re: indexing tags like cscope in fortran?
- Previous by thread: Fortran write(print) problem
- Next by thread: Re: Fortran write(print) problem
- Index(es):
Relevant Pages
|