C Library Functions  - 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,lgth)

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

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. Assumed to be of sufficient length
lgth 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


Nemo Release 3.1 notabs (3) July 22, 2023
Generated by manServer 1.08 from a2141c85-49b6-4397-8697-2f1fcee8e45e using man macros.