If I would like to exectute the following awk code as python code what would be the best way forward? If I was to use a list how would I popluate the list such that in the end I could print out fields 1 and 3 back to an output list and write this to a file.
thanks
graham
AWK
#!/bin/awk -f
BEGIN {
FS=":";
}
{
print $1,$3
}
test file
Error code 27: This is error code 27:Ihave no comment here
Error code 24: This is error code 27:Ihave no comment here
Error code 27: This is error code 27:Ihave no comment here
Error code 26: This is error code 27:Ihave no comment here
Error code 27: This is error code 27:Ihave no comment here
Error code 29: This is error code 27:Ihave no comment here
Error code 01: This is error code 27:Ihave no comment here
1 Answer