How to extract data from a spreadsheet with perl script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mlr214
    New Member
    • Jan 2017
    • 1

    How to extract data from a spreadsheet with perl script

    I am very new to perl programming and need help:

    I have a spreadsheet with multiple columns and I am interested in extracting data from just 3 columns.
    Column A has gene names
    Column B has a sample id
    Column C has a characteristic of the sample.
    I want for each unique value in column A to print the sample IDs (columnB) that match that gene name and the associated characteristic (columnC)
    Example:
    Column A Column B Column C
    gene1 1T pink
    gene1 6T blue
    gene2 4T green
    gene2 4T green
    gene2 2T pink
    gene3 1T pink

    output to be a tab delimitated text file
    gene 1 2 pink,blue
    gene2 2 green,pink
    gene3 1 pink
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    Use one of the parser modules on cpan.

    Comment

    Working...