enoshbansode

Friday, February 13, 2015

Awk script to read and write to file

Awk script to read from a file and format the string and write the out in another file.

Input file

ABC;def;ghi;jkl
Mno;pqr;stu;vwx

Awk script

#!/bin/ksh

FILENAME= $1

awk 'BEGIN {FS=";"} {printf " update table set column= '\''%s'\'' where column= something \n" , $2 > "output file.txt"} ' $FILENAME

…..............

Run script
Scriptname inputfilename

Posted by Enosh Bansode at 6:03:00 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: awk script to read and write to file
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2025 (4)
    • ▼  June (4)
      • Root Cause Analysis Methods
      • Apache Kafka usecases
      • How to accept feedback effectively?
      • Cloud Foundry
  • ►  2018 (1)
    • ►  March (1)
  • ►  2017 (1)
    • ►  February (1)
  • ►  2016 (2)
    • ►  August (1)
    • ►  January (1)
  • ►  2015 (10)
    • ►  December (2)
    • ►  April (2)
    • ►  March (3)
    • ►  February (2)
    • ►  January (1)
  • ►  2014 (9)
    • ►  December (1)
    • ►  August (2)
    • ►  July (5)
    • ►  June (1)
  • ►  2013 (2)
    • ►  April (1)
    • ►  March (1)
  • ►  2012 (44)
    • ►  December (2)
    • ►  November (5)
    • ►  October (6)
    • ►  September (9)
    • ►  August (7)
    • ►  July (3)
    • ►  June (1)
    • ►  May (5)
    • ►  April (4)
    • ►  March (1)
    • ►  February (1)
Picture Window theme. Powered by Blogger.