Howdy:

I must be going about this the wrong way.  I'm trying
to modify a script and concatenates text files into
one large file.  That works.

There is a part where inside the text file are six
columns.  The last column is what I need to edit.
It's alpha_numerical.  I want to edit the sixth
column and put a zero (0) in front of whatever is
in that column.  So, I want to go from:

[sample]

2001q2  06      P92786          IEMMM01         1       6
2001q2  06      P92786          IEMMM01         1       8
2001q2  06      P56576          IEMFF01         1       23


to this:

2001q2  06      P92786          IEMMM01         1       06
2001q2  06      P92786          IEMMM01         1       08
2001q2  06      P56576          IEMFF01         1       023

[/sample]

Between the fields are spaces AND tabs.  I thought I'd
have to figure out how to split the file, make an array 
out of each column and then rewrite / edit into the same
file.

I think it should be easy if I do something like:

$vals[5] =~ s/(\w+)/(0$1)/g;

but it doesn't seem to be working.

Sorry - I don't have a script per se, I keep editing
whatever I have from examples ... so it looks pretty
much blank each time.

Suggestions?

-X

Reply via email to