[TriLUG] Need some help parsing a file

R Radford rradford at mindspring.com
Tue Dec 31 11:46:45 EST 2013


The tr solution would also reduce repeated spaces in the filename, so would
not work in that (hopefully extreme, but legal) case.



On Tue, Dec 31, 2013 at 10:53 AM, John Vaughters <jvaughters04 at yahoo.com>wrote:

> >Almost. Tom's ORIGINAL third line contains two tabs (\t or 011) in the
> >third line. Tabs got converted to spaces somewhere in the e-mail
> >processing. Doesn't work on that line if tabs are in place.
>
>
>
> Peter,
>
> You are keeping me on my feet. Test file contains the tab. I will say the
> tab is an unlikely situation for this type of output.
>
>  cat test | awk -F "[\040\011][,0-9]+[\040\011]" '{print $2}'
>
>
> This works with tab or space. But I have to admit, now I am getting to the
> point that I like to stay away from and that is complicated REGEX that is
> confusing to many that do not use it.
>
> Tom,
>
> I do like your tr solution very much. Some super minimal embedded products
> do not have awk (very few), but do have tr. It's always good to have the
> classic unix solutions on hand for my job.
>
> Thanks for sharing,
>
> John Vaughters
> --
> This message was sent to: Rodney Radford <rradford at mindspring.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  :
> http://www.trilug.org/mailman/options/trilug/rradford%40mindspring.com
> Welcome to TriLUG: http://trilug.org/welcome
>


More information about the TriLUG mailing list