Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


awk_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
awk_examples [2017/01/23 11:14] juckinsawk_examples [2019/06/28 09:45] juckins
Line 1: Line 1:
 ==== awk examples ==== ==== awk examples ====
  
-<code> +  cat files_changed_within_72hrs.sort.txt | awk -F " " '{print $NF}'
-cat files_changed_within_72hrs.sort.txt | awk -F " " '{print $NF}' +
-</code>+
  
 +  cat files_changed_within_72hrs.sort.txt | awk -F " " '{print $3,$5}'
 +  
 +Turn something like <nowiki>FreeWind_SFC not in ONA_GRID__GFS_20190627_1800</nowiki>
 +\\
 +\\
 +into <nowiki>FreeWind_SFC ONA_GRID__GFS</nowiki>
 +\\
 +\\
 +Using:\\
 +
 +  awk -F " " '{print $10,$13}' | sed -E 's/[0-9]*//g'| sed -E 's/__$//g' |tail -4
 +
 +(Adjust the $10,$13 fields as appropriate)
awk_examples.txt · Last modified: 2019/06/28 09:45 by juckins