[UP]


Manual Reference Pages  - notabs (3)

NAME

notabs(3f) - [M_strings:NONALPHA] expand tab characters (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Results
Examples
See Also
Author
License

SYNOPSIS

subroutine notabs(INSTR,OUTSTR,ILEN)

    character(len=*),intent=(in)  :: INSTR
    character(len=*),intent=(out) :: OUTSTR
    integer,intent=(out)          :: ILEN

DESCRIPTION

NOTABS() converts tabs in INSTR to spaces in OUTSTR while maintaining columns. It assumes a tab is set every 8 characters. Trailing spaces are removed.

In addition, trailing carriage returns and line feeds are removed (they are usually a problem created by going to and from MSWindows).

What are some reasons for removing tab characters from an input line? Some Fortran compilers have problems with tabs, as tabs are not part of the Fortran character set. Some editors and printers will have problems with tabs. It is often useful to expand tabs in input files to simplify further processing such as tokenizing an input line.

OPTIONS

instr Input line to remove tabs from

RESULTS

outstr Output string with tabs expanded.
ilen Significant length of returned string

EXAMPLES

Sample program:

   program demo_notabs

! test filter to remove tabs and trailing white space from input ! on files up to 1024 characters wide use M_strings, only : notabs character(len=1024) :: in,out integer :: ios,iout do read(*,’(A)’,iostat=ios)in if(ios /= 0) exit call notabs(in,out,iout) write(*,’(a)’)out(:iout) enddo end program demo_notabs

SEE ALSO

GNU/Unix commands expand(1) and unexpand(1)

AUTHOR

John S. Urban

LICENSE

Public Domain


notabs (3) March 11, 2021
Generated by manServer 1.08 from 9671c59e-21eb-4760-9951-075cec8ac2c3 using man macros.