GBGET(1)

πŸ“¦
version 6.3 Β· 2 versions
  • 6.3 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 6.0 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– GBGET(1) β€” the basic data extraction & manipulation tool πŸ’–

okay bestie, listen UP, because this one is genuinely iconic. This is the manual page for gbget, a User Command (section 1 of the manual, iykyk), and it's about to become your new main character. πŸŽ€


✨ NAME ✨

gbget β€” Basic data extraction and manipulation tool πŸ¦‹


🌸 SYNOPSIS 🌸

gbget [options] 'filename[index](C,R)trans'

πŸ’… DESCRIPTION πŸ’…

So basically? gbget prints slices of tabular data from files, and then it applies transformations to them. That's the whole vibe. ✨

Data get read from text files where the fields are separated by a space β€” and if you want a different separator, bestie, just use option -F. 🌈

Inside a data file, data-blocks are separated by two empty lines. Also, the file can be compressed with zlib (.gz), because we support that. πŸ’–

Now let's break down every single piece of that synopsis, because you will need all of it:

  • filename β€” this is the input file. If you don't specify it, it defaults to stdin, or to the last specified filename if there was one. 🫢
  • index β€” stands for a data-block index.
  • index β€” stands for a data-block index. (yes girl, it says it twice. I don't make the rules. πŸ’€)
  • C,R β€” stands for columns and rows spec, given as "min:max:skip", which selects from min to max every skip steps. If min and max are negative, they get counted from the end. By default all data are printed ("1:-1:1"). And here's the twist: if min>max, then the count is reversed and skip must be negative (-1 by default). Different specs are separated by semicolon ; and are considered sequentially. πŸ”₯
  • trans β€” is a list of transformations applied to the selected data. The roster is:
    • d β€” take the diff of subsequent columns
    • D β€” remove all rows with at least one Not-A-Number (NAN) entry
    • f β€” flatten the output, piling all columns
    • l β€” take log of all entries
    • P β€” print all entries collected as a data-block
    • t β€” transpose the matrix of data
    • z β€” subtract from the entries in each column their mean
    • Z β€” replace the entry in each column with their zscore
    • w β€” divide the entry in each column by their mean
    • '<..;..>' β€” functions separated by semicolons in angle brackets can be used for generic data transformation; the function is computed for each row of data. Variable names are x followed by the number of the column, and optionally by l and the number of lags. For instance x2+x3l1 means the sum of the entries in the 2nd column plus the entries in the 3rd column in the previous row. And x0 stands for the row number, while x is equal to x1. 🧚
    • '<@..;..>' β€” if the functions specification starts with a @, the functions are computed recursively along the columns. In this case the number after the x is the relative column, counted starting from the one considered at each step. ⭐
    • '{...}' β€” a function in curly brackets can be used to select data: only rows that return a non-negative value are retained. πŸ‘‘

✨ OPTIONS ✨

  • -F β€” set the input fields separators (default ' \t') 🌸
  • -o β€” set the output format (default '%12.6e') πŸ’œ
  • -e β€” set the output format for empty fields (default '%13s') πŸŽ€
  • -s β€” set the output separation string (default ' ') 🌈
  • -t β€” define global transformations applied before each output (default '') πŸ’–
  • -v β€” verbose mode πŸ¦‹

πŸ”₯ EXAMPLES πŸ”₯

Okay this is the part where it all clicks, watch:

gbget 'file(1:3)ld'

select the first three columns in file, take the log and the difference of successive columns; ✨

gbget 'file(2,-10:-1)
       <x^2> select the last ten elements of the second' of 'file' and
       print their squares

select the last ten elements of the second' of file and print their squares πŸ’…

gbget '[2]()' '[1]()' < ...

select the second and first data block from the standard input. 🫢

gbget 'file(1:3)<x1*x2-x3>'

select the first three columns in file and in each row multiply the first two entries and. subtract the third. 😭

gbget 'file()<@x1+x2>'

print the sum of two subsequent columns πŸ”₯

gbget 'file(1:3){x2-2}'

select the first three columns in file for the rows whose second field is not lower then 2 πŸ‘‘


🌸 AUTHOR 🌸

Written by Giulio Bottazzi πŸ’–


πŸŽ€ REPORTING BUGS πŸŽ€

Report bugs to <gbutils@googlegroups.com> β€” yes, fr fr, tell them everything. πŸ™ˆ

Package home page: <http://cafim.sssup.it/~giulio/software/gbutils/index.html> 🌐


Copyright © 2001-2018 Giulio Bottazzi. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation; ⭐

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ⚠️ (no cap, read the license, bestie)

and that's the whole page, you ate it, periodt πŸ’…βœ¨

This is gbget version 6.2, dated June 2021 β€” that's the source and the date for ya, and yes, this manual page is filed under GBGET(1) in the User Commands section. Go forth and slice that data, queen. πŸ‘‘πŸ¦‹πŸŽ€