Bolster
Bolster

Reputation: 7916

Using Double Quotes as Record Separator in AWK

Question says it all. I've tried using awk 'BEGIN{RS=\"} /Match/{print $0}' input and every combination of escaping and quoting I could think of. Any Ideas how to pull this off?

Upvotes: 0

Views: 2948

Answers (2)

Dennis Williamson
Dennis Williamson

Reputation: 360683

This also works:

awk 'BEGIN{RS="\""} /Match/{print $0}'

Upvotes: 0

ghostdog74
ghostdog74

Reputation: 343143

you can use \042.

awk 'BEGIN{RS="\042"}{}' file

or

awk -vRS='"' '{}' file

Upvotes: 3

Related Questions