Replace Static with Variable but leave alone text between them

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a lengthy list of similar entries, with multiple lines in each entry,
in a .txt file with spaces separating columns of data. (Sample below) I want
the first "Empl Total" to change to "Name1 Total," the second "Empl Total" to
change to "Name2 Total," etc. How?

The names are not all unique. I do not mind too much finding all Name1 &
replacing "Empl" with "Name1," then find all Name2, etc. separately.

Bonus: and I'd love the Name Total cost column to still line up so it'll
work when I import it all to Excel.

Name System Unit Usage Cost
Name1 VM CPU Hr .04 .06
VM DASD Gig .09 .13
Empl Total .19

Name2 VM CPU Hr .06 .09
VM DASD Gig .05 .07
Empl Total .16
 
There are different ways to make the adjustment. One way is to designate Tab
alignments, and set smaller margins. The margins should be equal length, on
all sides, and smaller for more layout space. It gets a little tricky with
the number of characters, per column. Start first with the titles, left to
right, through preset tabs. Then enter the data, one horizontal line at a
time, also left to right.

You still might have to readjust, depending on space available, font size,
etc. The decimel points in the numerical data, should have tabs set, in line
with the first uppercase letter of the column labels i.e. first point under
the letter "U". It looks like "Empl Total" contains the most characters, so
this has to be accounted for in advance, through tab settings.

There are still other ways. This might not be the best. It's just an option.
 
Back
Top