resources:awk_resources
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| resources:awk_resources [2016/01/14 12:57] – anthony | resources:awk_resources [2019/05/22 16:08] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 34: | 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.1452794225.txt.gz · Last modified: (external edit)
