Re: removing blanks from a file
- From: "David Frank" <dave_frank@xxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 06:19:43 -0400
Blanks (or any desired char) can be removed from a file record with 1
statement.
! ---------------
program test
character :: line*80, a(80), pad(80)=' ' ; equivalence (a,line)
open (1,file='old.txt') ! create test file
write (1,*) ' 1, 11, 111, 1111'
write (1,*) ' 2, 22,222, 2222'
rewind (1)
open (2,file='new.txt')
do
read (1,'(a)',end=101) line ; a = pack(a,a/=' ',pad)
write (2,*) trim(line)
end do
101 stop
end program
.
- Follow-Ups:
- Re: removing blanks from a file
- From: David Frank
- Re: removing blanks from a file
- References:
- removing blanks from a file
- From: Luka Djigas
- removing blanks from a file
- Prev by Date: Re: pass several filenames to the subroutine
- Next by Date: Re: linking g95-built library from VC++
- Previous by thread: Re: removing blanks from a file
- Next by thread: Re: removing blanks from a file
- Index(es):