Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding spaces after a word to obtain a string of n characters

Status
Not open for further replies.

xuenylom

Programmer
Aug 24, 2004
7
FR
hi,

I have to replace words in a file (lets name it BEFORE FIC) from a word list. the word list is set as follows

word1 word1_after
word2 word2_after


when I find word1 in BEFORE FIC, I have to replace it by word1_after, given that they will always have the same length (the only thing that can change is letters in lower/upper case). So far so good. But since words in BEFORE FIC are in fields, I need to keep the same length for the fields.

for example, in a field I have word1 followed by 5 spaces, which makes a field length of 10 chars.

I thought about using the function JUSTIFY to complete my new field with spaces so I get a new field of 10 chars.
problem is, all the examples of JUSTIFY i've seen always have 2 words or more. In the case of only one word, can JUSTIFY do the trick?
 
Code:
field1 = Left(word1_after,10)

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top