[mesa-users] how to extract columns from existing log file

Robert FARMER rjfarmer at asu.edu
Mon Oct 20 13:39:57 EDT 2014


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141020/2bb74d14/attachment.html>


More information about the Mesa-users mailing list