Advertisement
Dyrcona

fgextract.awk

Mar 22nd, 2019
3,344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.48 KB | None | 0 0
  1. BEGIN {
  2.   OFS=","
  3.   print "log_time", "circulation", "fine_interval", "recurring_fine", "max_fine", "stop_fines", "stop_fines_time"
  4. }
  5.  
  6. /generate_fines/ {
  7.   time = $3
  8.   circ = $10
  9.   if (time ~ /^0[6-8]/) {
  10.     next
  11.   }
  12.   else {
  13.     CMD = "psql -U evergreen -h 10.250.60.60 -A -t -F, -P footer -c 'select fine_interval, recurring_fine, max_fine, stop_fines, stop_fines_time from action.circulation where id = " circ "'"
  14.     CMD | getline data
  15.     close(CMD)
  16.     print time, circ, data
  17.   }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement