> On Tuesday, September 9, 2003, at 08:58  PM, perlwannabe wrote:
>
<SNIP, SNIP>

>> I know it involves using the s/// operator to both strip the tabs and
>> replace with <sp> but the problem is that it requires using an array
>> for
>> each address...and that is what is creating problems for me.
>>
>> Thanks...
>
> Hmm, let me think out loud a little.
>
> I think I see a pattern, so let's first change all of them to spaces.
> That's easy enough:
>
> s/\t/ /g;
>
> Now, if we switch all the spaces that are supposed to be tabs to tabs,
> we're done, right.  I bet we can handle that.  What about:
>
> s/ ([A-Za-z]:) /\t$1\t/g;
> # and...
> s/^([A-Za-z]:) /$1\t/;        # The first one is a special case
>
> # or, most complex...
>
> s/(^| )([A-Za-z]:) / length($1) ? "\t$1\t" : "$1\t" /eg;
>
> You may have to adjust it a little if any of my assumptions are wrong,
> but it should be close to what you need, I think.  Does that help any?


Yes, but the problem is that there is a mix of numbers and letters in the
address.  There is a response to the list that was right on the money. 
But, your example definitely put me on the right track in dealing with a
more complex s/// operator.  Thanks!




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to