Reputation: 1953
For some reason a backslash doesn't work. This is for a file with delimited data.
Right now this is my expression is:
output=$(awk -F '|''BEGIN {count=0;} $2==Smith {count++; print count $1}' customer)
echo $output
gives me
11001 21002 31003
I want the output to look like:
1. 1001
2. 1002
3. 1003
This is my attempt..
awk -F '|''BEGIN {count=0;} $2==Smith {count++; print count, '\.', $1}' customer
Upvotes: 0
Views: 123
Reputation: 5658
Print the statement with double quotes:
awk -F '|' 'BEGIN {count=0;} $2==Smith {count++; print count". "$1}' customer
Upvotes: 4