Tab limited file manipulation in PERL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akhilciba
    New Member
    • Sep 2016
    • 5

    Tab limited file manipulation in PERL

    Hai i have a tab limited file (see the attachment 1.xls) and i want to extract only 2,7,8 columns(2.xls) how it possible with a perl code
    Attached Files
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    Open a read filehandle to the source file and a write filehandle to the output file.

    Loop over the source file line-by-line and use the split() function to put the fields into an array and then output the desired 3 array elements to the output filehandle.

    There are several variations on how to do each step and there are modules available, such as Text::CSV_XS, to help but using the module would not be required.

    Comment

    Working...