resources:awk_resources
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
resources:awk_resources [2016/01/14 12:55] – created anthony | resources:awk_resources [2019/05/22 16:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~TOC:1-4~~ | ||
+ | |||
====== awk programming resources ====== | ====== awk programming resources ====== | ||
Line 5: | Line 7: | ||
< | < | ||
- | Anthony did this for the MathWONC project (see [[internal: | + | Anthony did this for the MathWONC project (see [[internal: |
Here is the code from '' | Here is the code from '' | ||
Line 32: | Line 34: | ||
rm temp.csv | rm temp.csv | ||
</ | </ | ||
+ | |||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | |||
+ | ====== Sort article lists by year using awk and sed ====== | ||
+ | |||
+ | [Originally from Anthony' | ||
+ | |||
+ | Exported bibliography to clipboard in Zotero, pasted into Emacs to write new file: | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | Try using awk to print column with year before whole rest of line | ||
+ | |||
+ | <code bash> | ||
+ | gawk ' | ||
+ | </ | ||
+ | |||
+ | Remove parens from FIRST (year) on a line: | ||
+ | |||
+ | <code bash> | ||
+ | sed -r ' | ||
+ | </ | ||
+ | |||
+ | Used rectangle register copy trick in Emacs to copy only first five chars (catches both 2012 and 2012b) and pasted ultimately to Excel column. | ||
\\ | \\ |
resources/awk_resources.1452794130.txt.gz · Last modified: 2019/05/22 16:08 (external edit)