[mesa-users] how to extract columns from existing log file
Aaron Dotter
aaron.dotter at gmail.com
Mon Oct 20 13:42:05 EDT 2014
Hi Bill,
I was just about to recommend gawk but Rob sorta beat me to it. It's like
awk but traditional awk might choke on 100s of MBs of data. gawk should
not.
Otherwise it works just like awk in Rob's email.
Aaron
On Mon, Oct 20, 2014 at 1:39 PM, Robert FARMER <rjfarmer at asu.edu> wrote:
> If you know the column numbers you could do:
>
> awk '{print $NUM1,$NUM2...}' file
>
> where $NUM1 is column numbers,
> $0 is the whole line
> $1 first column etc
>
> If you want to skip the header then you can do this:
> awk '{if(NR>2) print $1,$2...}' file
>
> Where NR tracks the number of rows
>
> Rob
>
>
>
> On Mon, Oct 20, 2014 at 10:35 AM, Bill Paxton <paxton at kitp.ucsb.edu>
> wrote:
>
>> Some unix wizard out there will have a solution for this one I'm sure.
>>
>> I have a monster history.data file (100s of MB) with lots and lots of
>> columns, most of which are unneeded for my current task --
>> it would be lovely to have a simple way to extract a small subset of the
>> columns to create a much smaller history.data file.
>> ideally, i'd give this marvelous tool a file with a list of the column
>> names that i want and it would do the rest.
>>
>> and of course i don't want to have to do any work to create this tool for
>> myself. i want Santa Claus to give it to me. now. ;D
>>
>> Thanks,
>> Bill
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Comprehensive Server Monitoring with Site24x7.
>> Monitor 10 servers for $9/Month.
>> Get alerted through email, SMS, voice calls or mobile push notifications.
>> Take corrective actions from your mobile device.
>> http://p.sf.net/sfu/Zoho
>> _______________________________________________
>> mesa-users mailing list
>> mesa-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mesa-users
>>
>
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141020/3ed95a94/attachment.html>
More information about the Mesa-users
mailing list