It's hyperlinked to the Gawk manual, but it seems likely he actually meant A, W & K's The Awk Programming Language (1988), which you could conceivably read in 2 hours, as it's a joy to read. I used it and The C Programming Language as exemplars of great documentation when writing my own.
Awk: `Begin { ` Part 1
31–40 of 110 posts
Re: Awk: `Begin { ` Part 1
#32Standard awk warning: it's tempting to try to use awk on csv files. You'll even get good results on simple csv files that leave you encouraged to go further. Don't. Csv is not standardized and the quoting rules are weird (and not standardized). If you can live with a certain amount of loss of fidelity in your output, you can get away with using awk. If you want a coarse prototype, use awk. If you need robust, product…
Re: Awk: `Begin { ` Part 1
#33Standard awk warning: it's tempting to try to use awk on csv files. You'll even get good results on simple csv files that leave you encouraged to go further. Don't. Csv is not standardized and the quoting rules are weird (and not standardized). If you can live with a certain amount of loss of fidelity in your output, you can get away with using awk. If you want a coarse prototype, use awk. If you need robust, product…
Everything you just described seems like reasons to not use CSV files in general, rather than not use AWK on CSV.
Re: Awk: `Begin { ` Part 1
#34I don't agree that you can learn AWK in its entirety in two hours, but I do (strongly) agree that you can teach yourself the basics in two hours and those two hours are extremely well spent considering that AWK is useful for so many things. Surely handling the intricacies of CSV can be a pain, but let's face it: Most tasks are simple and its results are easily verified for correctness. Obviously, I don't write my pro…
Because I won't know ahead of time what all the interesting values or summaries will be, but if I know I can get it through AWK it will be cheap to extract or compute those values and summaries later, once I know what they are.
Re: Awk: `Begin { ` Part 1
#35Standard awk warning: it's tempting to try to use awk on csv files. You'll even get good results on simple csv files that leave you encouraged to go further. Don't. Csv is not standardized and the quoting rules are weird (and not standardized). If you can live with a certain amount of loss of fidelity in your output, you can get away with using awk. If you want a coarse prototype, use awk. If you need robust, product…
People are careless when writing CSV files because they think it is simple: just put a comma between columns, right?
Re: Awk: `Begin { ` Part 1
#36Re: Awk: `Begin { ` Part 1
#37> He said, “If you get the awk programming language manual…you’ll read it in about two hours and then you’re done. That’s it. You know all of awk.” It's hyperlinked to the Gawk manual, but it seems likely he actually meant A, W & K's The Awk Programming Language (1988), which you could conceivably read in 2 hours, as it's a joy to read. I used it and The C Programming Language as exemplars of great documentation when…
It is freely available at archive.org: https://archive.org/details/pdfy-MgN0H1joIoDVoIC7
Re: Awk: `Begin { ` Part 1
#38Earlier quoted context omitted.
The best description of dates and CSV files I've heard by far. Bravo. "Csv files are a little bit like like dates: superficially simple, with lots of corner cases. Largely for the same reason: lack of standardization."
I just attempted to run some government data through Python using the csv module. It worked like a charm, until it told me that a field had exceeded the maximum allowable length. A close look showed that a field began but did not end with a quotation mark. Using the csv.QUOTE_NONE flag resolved that, but did not remedy such quirks as short or long records. CSV files, depending on who generates them, are a bit like da…
Re: Awk: `Begin { ` Part 1
#39Standard awk warning: it's tempting to try to use awk on csv files. You'll even get good results on simple csv files that leave you encouraged to go further. Don't. Csv is not standardized and the quoting rules are weird (and not standardized). If you can live with a certain amount of loss of fidelity in your output, you can get away with using awk. If you want a coarse prototype, use awk. If you need robust, product…
Segue to something that I've been fighting with for years: Do you have a suggestion for working with CSVs in the CLI? Something that will show a table, with a single pixel border between cells, that allows searching for a value, copying a cell?
1. IPython with Pandas if I expect to do any in-depth exploration/manipulation of the data.
2. A short Python script like `python -c 'import csv, sys; r = csv.reader(sys.stdin); ...' 3. https://github.com/BurntSushi/xsv if I want to quickly munge some data or extract a field.
4. Gnumeric if I want a GUI.
5. https://github.com/andmarti1424/sc-im if I want a TUI. This is closest to what you were asking for.
Re: Awk: `Begin { ` Part 1
#40Standard awk warning: it's tempting to try to use awk on csv files. You'll even get good results on simple csv files that leave you encouraged to go further. Don't. Csv is not standardized and the quoting rules are weird (and not standardized). If you can live with a certain amount of loss of fidelity in your output, you can get away with using awk. If you want a coarse prototype, use awk. If you need robust, product…
$ ruby -rcsv -ne 'puts $_.parse_csv[1]' education.csv
Enrolment in primary, secondary and tertiary education levels
Total, all countries or areas
AWK is a nice little language. Perl is all of it and shell, sed, grep. I am not proficient in Perl but I know some Ruby $ ruby -rEnglish -ne 'puts $_ if $NR
Module English provides AWK names $ perl -MEnglish -ne 'print if $NR
https://ruby-doc.org/stdlib-2.3.0/libdoc/English/rdoc/Englis...