SHARE
TWEET

printf demo

a guest Oct 19th, 2012 25 Never
  1. bash-4.2$ echo 'Station Name
  2. Station Code
  3. A N %s DEV NAGAR
  4. ACND
  5. ABHAIPUR
  6. AHA
  7. ABOHAR
  8. ABS
  9. ABU ROAD
  10. ABR' | awk 'NR%2==1 {printf $0","} NR%2==0 { print $0}'
  11. Station Name,Station Code
  12. awk: cmd. line:1: (FILENAME=- FNR=3) fatal: not enough arguments to satisfy format string
  13.         `A N %s DEV NAGAR,'
  14.              ^ ran out for this one
RAW Paste Data
Top