Find the answer to your Linux question:
Results 1 to 3 of 3

Thread: trouble in awk

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    trouble in awk

    if i get some output as a "" seperated words how shud i extract say the 3 column of the file .. if i use awk how shud i use the OFS to specify "" as the seperator...

  2. #2
    gawk -F"\"\"" '{print $3}' input_file.txt

    should give you the third column of a file using two double quotes as a field delimiter.

    gawk -F, -v OFS="\"\"" '{print $1,$2,$3}' input_file2.txt

    should print first three columns of a file whose text is seperated by commas, output will be seperated by two double quotes.

  3. #3
    How can we do it with one "?
    less adrian-rhymes.html | grep '<a href=' |grep  '' | awk 'BEGIN { FS ="\"\"" } ; { print $2 }'

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts