Article View: bit.listserv.xedit-l
Article #800Another take on name capitalization
From: Dick Atlee
Date: Thu, 30 Apr 1992 12:57
Date: Thu, 30 Apr 1992 12:57
52 lines
2698 bytes
2698 bytes
I may have missed something, so I don't understand where filenames and
filetypes enter into Laszlo's question. If it is simply names that he
is referring to, I could offer the heart of an exec that we use to fix
the random way our help-desk consultants log our customer's names. I
have no pretensions to great REXX programming, by the way :-)
PARTICULARS SPECIFIC TO US:
In this, filei and fileo are the input and output files, the line
being parsed has last name in 25-44 and first name in 45-59. After
casing, these are padded and reassembled into the line.
THE SPECIFIC FUNCTION OF THIS CODE:
This capitalizes the first letter and leaves all others lower case --
e.g., "MACDONALD" comes out "Macdonald", "LeClerc" is "Leclerc", etc.
-----------------------------------------------------------------
lo = 'abcdefghijklmnopqrstuvwxyz'
up = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
eof = 'F'
do while eof = 'F'
'execio 1 diskr ' filei
if rc ^= 0 then eof = 'T'
else do
parse pull part1 25 namel 45 namef 60 rest
namel = strip(namel)
namef = strip(namef)
if length(namel) > 0 then do
nl = translate(substr(namel,1,1))
amel = translate(substr(namel,2),lo,up)
namel = nl||amel
end /* recasing last name */
if length(namef) > 0 then do
nf = translate(substr(namef,1,1))
amef = translate(substr(namef,2),lo,up)
namef = nf||amef
end /* recasing first name */
namel = left(namel,20,' ')
namef = left(namef,15,' ')
line = part1 || namel || namef || rest
push line
'execio 1 diskw ' fileo
end /* non-eof processing */
end /* whole file processing */
'execio 0 diskw' fileo '(FINIS'
---------------------------------------------------------------------
This may have some fatal flaws if generalized, but it has worked well for
us for several years.... Hope it's of some use.
Dick Atlee
Consulting Staff
University of Maryland
Technical Details
Message-ID:
<XEDIT-L%92043009023830@OHSTVMA.IRCC.OHIO-STATE.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!wupost!darwin.sura.net!paladin.american.edu!auvm!UMDC.BITNET!ATLEEShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c92b,3c60e46d9ca2c90d,start X-Google-Attributes: gid10c92b,public X-Google-ArrivalTime: 1992-04-30 05:57:52 PST Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!wupost!darwin.sura.net!paladin.american.edu!auvm!UMDC.BITNET!ATLEE From: ATLEE@UMDC.BITNET (Dick Atlee) Newsgroups: bit.listserv.xedit-l Subject: Another take on name capitalization Message-ID: <XEDIT-L%92043009023830@OHSTVMA.IRCC.OHIO-STATE.EDU> Date: 30 Apr 92 12:57:52 GMT Sender: VM System Editor List <XEDIT-L@UGA.BITNET> Lines: 52 Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU