Reading specific range of columns in an Excel file

Hi All,

I want to read an excel file.

PFA excel, I want to read the cloumn from A to G and the V to AH
starting from Row number 3.

Please help me on this.

Hello Abhisrajput,

Following may help you in same.

awk '{$8=$9=$10=$11=$12=$13=$14=$15=$16=$17=$18=$19=$20=$21=""} 1' Input_file

Thanks,
R. Singh

That can't be done on binary files with normal text utilities. Save as e.g. .csv formatted text file to enable that.
There may be perl modules that can solve your problem.

Sometimes apps save csv files with an .xls suffix, so the associate to excel. Otherwise, to batch process them, you need to write in PERL, VB or get them into csv or txt form: http://www.unix.com/shell-programming-and-scripting/218921-how-convert-excel-file-csv-file-text-file.html

#!/usr/bin/perl
use strict;
use warnings;
open my $fh, '<', 'CF_Resourcing' or die "Can't open file: $!\n";
while (<$fh>) {
    my @fields = split(/\t/);
    print "@fields[0,1,3,4,5,6,21,22,23,24,25,26,27,28,29,30,31,32,33]\n";
}

Just filter rows and columns after the "for each row/column".

Can you please help me with that. I am very new into Perl.

I am not a perl guru, but generally if you do not want to process a row or column, you can test in the row or column for loop with 'if' for ranges not desired and just 'continue', preventing their output. There were two for loops before, but now they are edited out! You may have to translate to zero based array indexing, so starting at row 3 may be "if ( x < 2 ) continue ;". There are samples and examples with the PERL libs on CPAN. Spreadsheet::ParseExcel - search.cpan.org