Sponsored Content
Top Forums Shell Programming and Scripting Perl script to extract second column from a xls Post 302446088 by durden_tyler on Tuesday 17th of August 2010 04:50:06 PM
Old 08-17-2010
Try out the Win32::OLE Perl module at CPAN.

Win32::OLE - search.cpan.org

Values in the 2nd column would be: $sheet->Cells($row,2)->{Value}

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to extract output from a script to .xls file

Hi, I am running a script, the output of which is needed to be filled in .xls file. I am doing this manually now, i mean I am writing the output of the script to Excel file manually. How to redirect the output of the script to .xls file? Please help me out!!! Thanks much, Scriptlearner. (6 Replies)
Discussion started by: scriptlearner
6 Replies

2. Shell Programming and Scripting

extract values from column with Perl

Hi everybody I have some problems with PERL programming. I have a file with two columns, both with numeric values. I have to extract the values > 50 from the 2nd columns and sum them among them. The I have to sum the respective values in the first column on the same line and, at the end, I... (6 Replies)
Discussion started by: m_elena
6 Replies

3. Shell Programming and Scripting

Reading a column from xls file using perl

Hi Everyone! I have a problem in reading a specific column from .xls file using perl language and then manipulating on given criteria. Detailed Description of the problem:: I have one .xls file, in which i have to populate two columns based on Period_date column which is in same file. My... (1 Reply)
Discussion started by: kvth
1 Replies

4. Shell Programming and Scripting

Extract first column from second line in perl

Hello Gurus I have a source file which has the first line as header and the rest are the records I need to extract the first column from the second line to extract a value I/P ... (7 Replies)
Discussion started by: Pratik4891
7 Replies

5. Shell Programming and Scripting

Perl script to get info from specific rows & columns (.xls file)

Hi all, I want to read some specific rows & columns in the .xls file with my script to get the data to be manipulated. Now, I can read the .xls file correctly & i can go to the specific sheet that I want but i have a problem to specify the specific rows & columns. I mean, I want to get the info... (0 Replies)
Discussion started by: Yohannita
0 Replies

6. Shell Programming and Scripting

Perl script to Convert XLSX or XLS files to CSV file

Hi All, I've got in a situation where I need to convert .xlsx or .xls formatted files into simple text file or .csv file. I've found many options but doing this using PERL script is the best way I believe.I'm in AIX box. Perl code should have 2 params while running. i.e perl... (1 Reply)
Discussion started by: manab86
1 Replies

7. Shell Programming and Scripting

Perl regexp to extract first and second column

Hi, I am trying with the below Perl one-liner using regular expression to extract the first and second column of a text file: perl -p -e "s/\s*(\w+).*/$1/" perl -p -e "s/\s*.+\s(.+)\s*/$1\n/" whereas the text file's data looks like: Error: terminated 2233 Warning: reboot 3434 Warning:... (3 Replies)
Discussion started by: royalibrahim
3 Replies

8. Shell Programming and Scripting

Perl script to convert xlsx to xls file

Hi I am trying one perl script to convert xlsx to xls file but could not able to get all the rows and columns in the xls file . This scriptFILE is basically to convert XLSX to CSV .. I am tweaking the script to convert XLSX to XLS file also #######################FILE... (3 Replies)
Discussion started by: kshitij
3 Replies

9. Shell Programming and Scripting

Perl - Extract first column from file

Hi, I want to extract first column from a file and redirect the output to another file in perl. I am able to do this from command line by executing below commands. perl -anle 'print $F' Input.dat > Output.dat perl -ne '@F = split("\t", $_); print "$F\n";' Input.dat > Output.dat perl -anE... (7 Replies)
Discussion started by: Neethu
7 Replies

10. Shell Programming and Scripting

Writing xml from excel sheet .xls using perl script

Hi all. I am working on the below requirement of generating .xml file from .xls file which i have , can someone please help me or in writing the perl script for the same: The xls file format is as below which has two columns and number of rows are not fixed: Fixlet Name ... (12 Replies)
Discussion started by: omkar.jadhav
12 Replies
OLE::Storage_Lite(3pm)					User Contributed Perl Documentation				    OLE::Storage_Lite(3pm)

NAME
OLE::Storage_Lite - Simple Class for OLE document interface. SYNOPSIS
use OLE::Storage_Lite; # Initialize. # From a file my $oOl = OLE::Storage_Lite->new("some.xls"); # From a filehandle object use IO::File; my $oIo = new IO::File; $oIo->open("<iofile.xls"); binmode($oIo); my $oOl = OLE::Storage_Lite->new($oFile); # Read data my $oPps = $oOl->getPpsTree(1); # Save Data # To a File $oPps->save("kaba.xls"); #kaba.xls $oPps->save('-'); #STDOUT # To a filehandle object my $oIo = new IO::File; $oIo->open(">iofile.xls"); bimode($oIo); $oPps->save($oIo); DESCRIPTION
OLE::Storage_Lite allows you to read and write an OLE structured file. OLE::Storage_Lite::PPS is a class representing PPS. OLE::Storage_Lite::PPS::Root, OLE::Storage_Lite::PPS::File and OLE::Storage_Lite::PPS::Dir are subclasses of OLE::Storage_Lite::PPS. new() Constructor. $oOle = OLE::Storage_Lite->new($sFile); Creates a OLE::Storage_Lite object for $sFile. $sFile must be a correct file name. The "new()" constructor also accepts a valid filehandle. Remember to "binmode()" the filehandle first. getPpsTree() $oPpsRoot = $oOle->getPpsTree([$bData]); Returns PPS as an OLE::Storage_Lite::PPS::Root object. Other PPS objects will be included as its children. If $bData is true, the objects will have data in the file. getPpsSearch() $oPpsRoot = $oOle->getPpsTree($raName [, $bData][, $iCase] ); Returns PPSs as OLE::Storage_Lite::PPS objects that has the name specified in $raName array. If $bData is true, the objects will have data in the file. If $iCase is true, search is case insensitive. getNthPps() $oPpsRoot = $oOle->getNthPps($iNth [, $bData]); Returns PPS as "OLE::Storage_Lite::PPS" object specified number $iNth. If $bData is true, the objects will have data in the file. Asc2Ucs() $sUcs2 = OLE::Storage_Lite::Asc2Ucs($sAsc>); Utility function. Just adds 0x00 after every characters in $sAsc. Ucs2Asc() $sAsc = OLE::Storage_Lite::Ucs2Asc($sUcs2); Utility function. Just deletes 0x00 after words in $sUcs. OLE
::Storage_Lite::PPS OLE::Storage_Lite::PPS has these properties: No Order number in saving. Name Its name in UCS2 (a.k.a Unicode). Type Its type (1:Dir, 2:File (Data), 5: Root) PrevPps Previous pps (as No) NextPps Next pps (as No) DirPps Dir pps (as No). Time1st Timestamp 1st in array ref as similar fomat of localtime. Time2nd Timestamp 2nd in array ref as similar fomat of localtime. StartBlock Start block number Size Size of the pps Data Its data Child Its child PPSs in array ref OLE
::Storage_Lite::PPS::Root OLE::Storage_Lite::PPS::Root has 2 methods. new() $oRoot = OLE::Storage_Lite::PPS::Root->new( $raTime1st, $raTime2nd, $raChild); Constructor. $raTime1st, $raTime2nd are array refs with ($iSec, $iMin, $iHour, $iDay, $iMon, $iYear). $iSec means seconds, $iMin means minutes. $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year - 1900. $raChild is a array ref of children PPSs. save() $oRoot = $oRoot>->save( $sFile, $bNoAs); Saves information into $sFile. If $sFile is '-', this will use STDOUT. The "new()" constructor also accepts a valid filehandle. Remember to "binmode()" the filehandle first. If $bNoAs is defined, this function will use the No of PPSs for saving order. If $bNoAs is undefined, this will calculate PPS saving order. OLE
::Storage_Lite::PPS::Dir OLE::Storage_Lite::PPS::Dir has 1 method. new() $oRoot = OLE::Storage_Lite::PPS::Dir->new( $sName, [, $raTime1st] [, $raTime2nd] [, $raChild>]); Constructor. $sName is a name of the PPS. $raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay, $iMon, $iYear). $iSec means seconds, $iMin means minutes. $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year - 1900. $raChild is a array ref of children PPSs. OLE
::Storage_Lite::PPS::File OLE::Storage_Lite::PPS::File has 3 method. new $oRoot = OLE::Storage_Lite::PPS::File->new($sName, $sData); $sName is name of the PPS. $sData is data of the PPS. newFile() $oRoot = OLE::Storage_Lite::PPS::File->newFile($sName, $sFile); This function makes to use file handle for geting and storing data. $sName is name of the PPS. If $sFile is scalar, it assumes that is a filename. If $sFile is an IO::Handle object, it uses that specified handle. If $sFile is undef or '', it uses temporary file. CAUTION: Take care $sFile will be updated by "append" method. So if you want to use IO::Handle and append a data to it, you should open the handle with "r+". append() $oRoot = $oPps->append($sData); appends specified data to that PPS. $sData is appending data for that PPS. CAUTION
A saved file with VBA (a.k.a Macros) by this module will not work correctly. However modules can get the same information from the file, the file occurs a error in application(Word, Excel ...). DEPRECATED FEATURES
Older version of "OLE::Storage_Lite" autovivified a scalar ref in the "new()" constructors into a scalar filehandle. This functionality is still there for backwards compatibility but it is highly recommended that you do not use it. Instead create a filehandle (scalar or otherwise) and pass that in. COPYRIGHT
The OLE::Storage_Lite module is Copyright (c) 2000,2001 Kawai Takanori. Japan. All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. ACKNOWLEDGEMENTS
First of all, I would like to acknowledge to Martin Schwartz and his module OLE::Storage. AUTHOR
Kawai Takanori kwitknr@cpan.org This module is currently maintained by John McNamara jmcnamara@cpan.org SEE ALSO
OLE::Storage Documentation for the OLE Compound document has been released by Microsoft under the Open Specification Promise. See http://www.microsoft.com/interop/docs/supportingtechnologies.mspx The Digital Imaging Group have also detailed the OLE format in the JPEG2000 specification: see Appendix A of http://www.i3a.org/pdf/wg1n1017.pdf perl v5.10.1 2009-11-24 OLE::Storage_Lite(3pm)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy