Re: removing blanks from a file




Luka Djigas wrote:
On 29 Jun 2006 18:11:38 -0700, "dpb" <dpbozarth@xxxxxxxx> wrote:

....

... , why not fix the output format so it
doesn't write the spaces to begin with?

Yes, I wrote the program which creates these files.
....
The scale usually varies between 1:1 and 1:50, so I suppose I could
write all those manually, and adapt them to the purpose, but surely
there must be another solution.

The simplest way is to use a fairly common extension, the zero-width
field width specifier. Assuming your compiler implements it, the
following example may help

program Temp
implicit none
real :: x, y, z

x = 1.3
y = 24.3
z = sqrt(1000.)
! Output comma-delimited with no spaces
write(*,'(SS,2(F0.5,1H,),F0.5)') x,y,z
end program Temp

C:\Temp\Debug> temp
1.30000,24.30000,31.62278

C:\Temp\Debug>

If you don't have access to this feature, post again. There are ways
to accomplish the objective but this is the simplest imo.

.