[nycbug-talk] Re: Simple sed question

Mikel King mikel.king
Fri Jan 7 13:46:17 EST 2005



Francisco Reyes wrote:

> One of these days I will learn to always reply with the right ID to 
> the list. :-(
>
> On Fri, 7 Jan 2005, George Georgalis wrote:
>
>> 507     AllianceBer Intl PremGr C     AIPCX   8.29    -2.24   -1.54
>> 508     AllianceBer Intl PremGrAd     AIPYX   8.87    -1.88   -0.67
>> 509     AllianceBer Intl Val A        ABIAX   14.91   5.59    9.79
>> 510  AllianceBer Intl Val A    ABIAX   14.91   5.59    9.79
>> 511 AllianceBer Intl Val A    ABIAX   14.91   5.59    9.79
>> 512 AllianceBer Intl Val A    ABIAX   14.91   5.59    9.79
>
>
>> s/[ \t]*/\t/g
>> substitute, any combination of spaces and tabs with one tab character,
>> globaly across the line (untested)
>
>
>  I don't think that's what I am looking for.
>  If you substitute spaces by a tab then the spaces inside the 
> description will
>  be made into tab. For example "AllianceBer Intl PremGr C" should 
> remain with
>  it's spaces.
>

Hi Francisco,


I am not exactly sure I am following you requirements but from what I've 
gathered it sounds like this could be a task for awk.

Is the delimination between the # and TEXT a tab or space? If it is a 
space is it always the same quatity, making the columns?

If for instatnce it were 4 spaces you could do someting like;

cat {Your Ouput} | awk -F "    " '{print $1}'

If it were a tab then change the 4 space charaters to a tab and do the 
same thing.

Does this help?

cheers,
m!




More information about the talk mailing list