Extract specified columns from big file - with cat or perl/python script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erapop
    New Member
    • Mar 2013
    • 4

    Extract specified columns from big file - with cat or perl/python script

    I have a BIG text file (+700 mega) with data line,like

    "id1","username 1","password1", "FIRSTNAME1","e mail1","subscri ber1","date1",e tc
    "id2","username 2","password2", "FIRSTNAME2","e mail2","subscri ber2","date2",e tc

    and i want to extract specified columns -FIRSTNAME- from each lines + I dont want , or " in results, the results must be in comuns

    How i can do it? Thanks for help
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    If you know how the file is set up, and you know that there will always be "" around the entries (if there are 'blanks' they'll appear as "") then you should be able to use awk to pull the columns you want and put them where you wanted.

    Comment

    • erapop
      New Member
      • Mar 2013
      • 4

      #3
      yes, all columns are separated with " " - please help me with the exactly awk command, thanks

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        The awk users guide is here, you would need to specify the exact columns you wanted, and where you wanted them to go.

        Comment

        • rski
          Recognized Expert Contributor
          • Dec 2006
          • 700

          #5
          try this
          Code:
          cat <your filename> | cut -d"," -f 4 | sed 's/"//g'

          Comment

          Working...