Home:ALL Converter>Running awk command in awk script

Running awk command in awk script

Ask Time:2018-03-20T12:11:26         Author:Ububtunoob

Json Formatter

I am just looking to run a simple script that runs an awk command inside of the awk script.

sample_enrollment.csv file: "EffectiveDate","Status","EmployeeID","ClientID"

Below is the Lab4_1.awk

 #!/bin/bash

BEGIN{FS=","}

{
awk 'gsub(/EfectiveDate/, "Effective Date")'
}

I am running the command from the command line like this

awk -f lab4_1.awk sample_enrollment.csv

The error that I am getting seems to indicate that the ' ' in the awk gsub command seem to be wrong. I have tried many variations on this awk command with out any luck. I am just asking for this portion, as I will need to add more to the awk script after I get this done

Any help would be appreciated. Thank you

Author:Ububtunoob,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49376218/running-awk-command-in-awk-script
yy