(file) Return to data_row.f CVS log (file) (dir) Up to [HallC] / Analyzer / UTILSUBS

File: [HallC] / Analyzer / UTILSUBS / data_row.f (download)
Revision: 1.3, Wed Feb 2 18:45:17 1994 UTC (30 years, 7 months ago) by cdaq
Branch: MAIN
CVS Tags: spring03, sep0596, sep-26-2002, sep-25-2002, sep-24-2002, sep-09-2002, sane, pionct, online07, online04, online03, oct1199, oct1194, nov2894, nov2696, mduality, may2495, may1894, mar1495, mar-24-2003, jun1794, jun1594, jun1394, jun0794, jul2895, jul0794, jan2795, jan2496, jan1896, jan1796, gep_online, gep3, fpi2, emc, e01004, dec0694, bigcal, baryon, aug1794, aug0394, aug-12-2003, apr3096, apr1594, apr0695, apr-02-2003, Initial-CVS-Release, HEAD, Extra_Shower_Tubes_on_HMS_not_SOS
Changes since 1.2: +1 -0 lines
Add Log keyword

c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c
c  Handy & general string manipulations.
c
c     $Log: data_row.f,v $
c     Revision 1.3  1994/02/02 18:45:17  cdaq
c     Add Log keyword
c
c========================================================================
       SUBROUTINE data_row(string) 
       IMPLICIT NONE
       SAVE
       character*(*) string
       character*1024 pad
       integer out,imp,i,m,LENGTH
       logical last_blank,last_comma
       integer string_length	!FUNCTION
       integer g_important_length !FUNCTION
c
c      eliminates adjacent blanks, comments, packs with ","s 
c	ex: "1   2,	3" =>  "1,2,3,,,,,,,,,,,,,,,,,,,,"
c
	LENGTH= string_length(string)       !total length
        pad= string
	call NO_nulls(pad)			!remove nulls
	call NO_tabs(pad)			!remove tabs
	call NO_comments(pad)		!remove comments
	call NO_leading_blanks(pad)		!remove leading blanks
        call only_one_blank(pad)             !remove redundant blanks
        imp= g_important_length(pad)           !only nonblank length
c
        m= INDEX(pad,', ')
	DO WHILE(m.LT.imp .and. m.GT.0)
           string= pad(m+2:)
	   pad(m+1:)= string
           m= INDEX(pad,', ')
        ENDDO
*
        m= INDEX(pad,' ,')
        DO WHILE(m.LT.imp .and. m.GT.0)
           string= pad(m+1:)
           pad(m:)= string
           m= INDEX(pad,' ,')
        ENDDO
*
        m= INDEX(pad,' ')
        DO WHILE(m.LT.imp .and. m.GT.0)
           pad(m:m)= ','
           m= INDEX(pad,' ')
        ENDDO
*
        imp= g_important_length(pad)
        string= pad(1:imp)
        DO i= imp+1,LENGTH
           string(i:i)= ','
        ENDDO
        RETURN
        END

Analyzer/Replay: Mark Jones, Documents: Stephen Wood
Powered by
ViewCVS 0.9.2-cvsgraph-1.4.0