Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Writing without new line

intelgg
Beginner
1,980 Views
How can I write to a text file without automatically
having a new line? Say I want to use the statements:
write(6, '("123")')
write(6, '("456")')

and obtain:
123456
not
123
456
0 Kudos
2 Replies
TimP
Honored Contributor III
1,980 Views
How about
write(UNIT=6, FMT='("123")',ADVANCE=NO)

I believe Intel Fortran also supports the old non-standard DEC version of this.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,980 Views
Standard way: use ADVANCE="NO":
write(6, '("123")', ADVANCE="NO")
write(6, '("456")')
I'm not sure that will work for console output, though. Non-standard way is using (or $) edit descriptor:
write(6, '("123",)')
write(6, '("456")')
Jugoslav
0 Kudos
Reply