I'm trying to take the second segment of a line inside a file delimited by a certain string, and it would usually work something like awk -F ':: My Delimiter ::' '{print $2}', but if I try to print $2 it will print the second argument passed onto the function in which the awk command is located. Is there an alternate way to split a line by a delimiter and print a certain part of the result?
This is the exact line I'm having issues with:
for transaction in $(cat $1)
do
echo "$transaction" | awk -F ':: My Delimiter ::' '{print $2}' >> testLog.data.out
done
Note: The delimiter would be exactly as described. :: My Delimiter ::