Dear all,
I have written an awk script to read through the fields in a line in a text file and then concatenate each field up to the point where the it detects a field called "Running"
Example of file is as follows;
Log Collector Running 05-12-20 15:43 25991
so in this case the first and second field would be used and the output Log Collector then written to a file for further processing.
I have included my script, which isn't complete but equally it doesn't work properly either.
I have attached the output from the script as follows;
Log Collector Running 05-12-20 15:43 25991 Log
Log Collector Running 05-12-20 15:43 25991 Log Collector
Log Collector Running 05-12-20 15:43 25991 Log Collector 05-12-20
Log Collector Running 05-12-20 15:43 25991 Log Collector 05-12-20 15:43
Log Collector Running 05-12-20 15:43 25991 Log Collector 05-12-20 15:43 25991
for some reason the script is printing out the complete line as well as the those fields that are identified as not the "Running" field.
Any help would be appreciated.
I don't think I am getting my variable assignment right.
Thanks
Alf
I have written an awk script to read through the fields in a line in a text file and then concatenate each field up to the point where the it detects a field called "Running"
Example of file is as follows;
Log Collector Running 05-12-20 15:43 25991
so in this case the first and second field would be used and the output Log Collector then written to a file for further processing.
I have included my script, which isn't complete but equally it doesn't work properly either.
I have attached the output from the script as follows;
Log Collector Running 05-12-20 15:43 25991 Log
Log Collector Running 05-12-20 15:43 25991 Log Collector
Log Collector Running 05-12-20 15:43 25991 Log Collector 05-12-20
Log Collector Running 05-12-20 15:43 25991 Log Collector 05-12-20 15:43
Log Collector Running 05-12-20 15:43 25991 Log Collector 05-12-20 15:43 25991
for some reason the script is printing out the complete line as well as the those fields that are identified as not the "Running" field.
Any help would be appreciated.
I don't think I am getting my variable assignment right.
Thanks
Alf