Skip to content

Instantly share code, notes, and snippets.

@atondwal
Last active December 17, 2015 08:59
Show Gist options
  • Save atondwal/5584040 to your computer and use it in GitHub Desktop.
Save atondwal/5584040 to your computer and use it in GitHub Desktop.
time for i in `ls -d --color=none *txt`; do time awk '/^#yyyy/{print "#day_of_year hour min value";};/#/{print};/^[^#]/{system("date -u -d\""$1" "$2"\" +\"%j %k %M \"|tr -d \"\\n\"");print $3;}' <$i >$i.dated ; done;
time for i in `ls -d --color=none *dated`; do sed '/^#yyyy/ d' <$i >$i.new; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment