3

Need a very specific awk command for parsing records

view full story
linux-howto

http://www.unix.com – I have data in a file where the first line of the file identifies the fields. I need to be able to parse out any single record, field-by-field, with the fields identified. So if my file looks like this: NAME, ADDRESS, PHONE Jim Smith, 123 Main Street, 999-888-7777 Bob Jones, 555 Park Avenue, 666-555-4444 Mary Johnson, 753 Oak Street, 333-222-1111 I need to be able to query by name, say for "Bob Jones" and get the following output: NAME: Bob Jones ADDRESS: 555 Park Avenue PHONE: 666-555-4444 (HowTos)