GBGET(1)
π 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 tostdin, 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 frommintomaxeveryskipsteps. Ifminandmaxare negative, they get counted from the end. By default all data are printed ("1:-1:1"). And here's the twist: ifmin>max, then the count is reversed andskipmust be negative (-1by 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 columnsDβ remove all rows with at least one Not-A-Number (NAN) entryfβ flatten the output, piling all columnslβ take log of all entriesPβ print all entries collected as a data-blocktβ transpose the matrix of datazβ subtract from the entries in each column their meanZβ replace the entry in each column with their zscorewβ 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 arexfollowed by the number of the column, and optionally byland the number of lags. For instancex2+x3l1means the sum of the entries in the 2nd column plus the entries in the 3rd column in the previous row. Andx0stands for the row number, whilexis equal tox1. π§'<@..;..>'β if the functions specification starts with a@, the functions are computed recursively along the columns. In this case the number after thexis 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 π
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. ππ¦π
π¦ where this page comes from
- debian bookworm: gbutils 6.3-1 Β· GPL-2.0-or-later
- debian trixie: gbutils 6.3-1+b1 Β· GPL-2.0-or-later
- ubuntu noble: gbutils 6.3-1 Β· GPL-2.0-or-later
- ubuntu questing: gbutils 6.3-1build1
- ubuntu resolute: gbutils 6.3-1build2 Β· GPL-2.0-or-later
- ubuntu stonking: gbutils 6.3-1build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms