Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!ccelsn!art From: art@ccelsn (Art McClinton (703)883-6356) Newsgroups: comp.os.vms Subject: Re: FORTRAN DOUBLE SPACES PRINTED LINES WITH TABS Message-ID: <8803211327.AA00919@ccelsn.mitre.org> Date: 21 Mar 88 13:27:29 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The MITRE Corp., Washington, D.C. Lines: 35 I think that your problem stems from the fact that LINE is defined as CHARACTER*80. Thus it is blank filled on the right. A TAB is expanded to more than one blank but only fills one space in the array. The OPEN (UNIT=1... has nothing to do with this problem as the PRINT is not using it. You want to trim trailing blanks before you print. I suggest somthing like: CHARACTER*1 BLANK/' '/ DO LAST=80,1,-1 IF (LINE(LAST:LAST) .NE. BLANK) GO TO 100 END DO LAST=1 100 PRINT 20,LINE(1:LAST) 20 FORMAT(1X,A) Another way would be to determine the length during the READ. FOR EXAMPLE. READ(5,21,...) LENGTH,LINE(1:LENGTH) 21 FORMAT(Q,A) will result in LENGTH being set equal to the length of the array and the line is then read into the Character variable LINE. s* *---Art * *Arthur T. McClinton Jr. ARPA: art@mitre.arpa *Mitre Corporation Phone: 703-883-6356 *7525 Colshire Drive Internal Mitre: ART@MWVMS or M10319@MWVM *McLean, Va. 22102-3481 DCS: MCCLINTON * * I apologize for the presently non-replyable return addresses. Hope to * fix that soon.