Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2005
    Posts
    24

    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
    Just Joined!
    Join Date
    Apr 2005
    Posts
    23
    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
    Linux Newbie
    Join Date
    Dec 2005
    Posts
    104
    How can we do it with one "?
    Code:
    less adrian-rhymes.html | grep '<a href=' |grep  'http://media.ebaumsworld.com/' | awk 'BEGIN { FS ="\"\"" } ; { print $2 }'

Posting Permissions

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