Sponsored Content
Top Forums Shell Programming and Scripting Perl : to get all the hyperlinks from the xlsx sheet(hyperlinks not visible in excel sheet directly) Post 302780997 by DGPickett on Friday 15th of March 2013 10:53:58 AM
Old 03-15-2013
Well, I would start with man unzip and find how to get a file listing of the xlsx on stdout so I could filter out which are text-like, usually xml. Then I can use unzip to extract each of those files to stdout, where I can used sed to find and strip out the URLs I want. First look at it in pg or the like. Find the URL you know you want. There may be many URLs on a line, so you need to separate them onto different lines and dispose of non-URL lines and line bits. Something like
Code:
unzip <list_options> xxx.xlsx | pg
 
unzip <list_options> xxx.xlsx | egrep <patterns_you_like> | pg
 
unzip <list_options> xxx.xlsx | egrep <patterns_you_like> | xargs <run_only_if_input_opts> unzip <unzip_to_stdout_options> xxx.xlsx | pg
 
unzip <list_options> xxx.xlsx | egrep <patterns_you_like> | xargs <run_only_if_input_opts> unzip <unzip_to_stdout_options> xxx.xlsx | sed '<script_to_delete_separate_trim_URLs>' | pg

If you want to stay in PERL, there are unzip APIs http://perldoc.perl.org/IO/Uncompress/Unzip.html

And direct XLSX access APIs: http://search.cpan.org/~dmow/Spreads...dsheet/XLSX.pm

Last edited by DGPickett; 03-15-2013 at 12:53 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Excel sheet modification using perl module

Is there any possibility to move the content from one cell to another cell (Excel sheet) using perl module? (3 Replies)
Discussion started by: kavi.mogu
3 Replies

2. Shell Programming and Scripting

Excel sheet modification using perl module

I need to insert new column to already existing file ..can any one help me..?? (6 Replies)
Discussion started by: kavi.mogu
6 Replies

3. Shell Programming and Scripting

Excel sheet modification using perl module

Hi , Is there any possibility to read excel sheet in column by column order ?...Thanks in advance,........ :confused: (1 Reply)
Discussion started by: kavi.mogu
1 Replies

4. Programming

Excel sheet modification using perl module

Hi , can any one tell me,"How to extract the same format from existing excel file to new excel file " using Spreadsheet::WriteExcel or Spreadsheet::ParseExcel module ??? Example_pgm: Below program is used to read existing excel file..In this program "my $cell = $_;" line is used to... (0 Replies)
Discussion started by: kavi.mogu
0 Replies

5. Shell Programming and Scripting

Perl : not capturing all the data from excel sheet

Hi folks, I am working on assignment that captures all the records(2 columns one column contains names and other contain date of birth) from excel sheet stored in a directory and checks for current date and month. If it matches current date and month then the matched records are printed as... (1 Reply)
Discussion started by: giridhar276
1 Replies

6. Shell Programming and Scripting

Perl : Deleting the records in the excel sheet

I have a excel sheet with contains the records as below.. also uploaded the input excelsheet and the output excel sheet(expected output). 322mpls32.net.xyz.comBW: 44.0 M Hrly Avg (IN /... (1 Reply)
Discussion started by: giridhar276
1 Replies

7. Shell Programming and Scripting

Perl :Is it possible to read the excel 2007 sheet on unix machine using spredsheet::xlsx module

I have an Excel 2007 excel sheet on windows machine and using Spreadsheet::XLSX I had written a script to read the excel sheet and was successful. My requirement is I need to generate another excel sheet from the old excel 2007 sheet on unix machine. Now is it possible to read the excel... (2 Replies)
Discussion started by: giridhar276
2 Replies

8. Shell Programming and Scripting

Perl Reading Excel sheet isssue

There is a perl scriptwhich will read Excel sheet and create one file(.v) . Excel sheet::: A B C D 1 cpu_dailog 2 3 4 Perl will create the file(.v) like thsi ::: assert (cpu_dailog_iso ==2) ; assert (cpu_dailog_reset ==3); assert (cpu_dailog_idle... (3 Replies)
Discussion started by: naaj_ila
3 Replies

9. Shell Programming and Scripting

Uploading excel sheet to sharepoint portal using perl

Thourgh Perl scripting, Is it possible to upload excel sheet to sharepoint portal ? If the answer is YES.. Could you please share your thoughts and required CPAN modules or any examples to proceed further? Regards, Giridhar S ---------- Post updated at 04:26 AM ---------- Previous update... (0 Replies)
Discussion started by: giridhar276
0 Replies

10. Shell Programming and Scripting

Summing up the data from different excel sheet into one excel sheet

Hi Folks, Can you please advise for any script in unix such that for example , i have 3 different excel sheet at the location /ppt/gfr/exc so the name s of the excel sheet are 1excel.xslx 2excel.xslx 3excel.xslx now in these 3 different excel sheet there is lot of data for example each... (3 Replies)
Discussion started by: punpun66
3 Replies
Spreadsheet::ParseExcel::Simple(3pm)			User Contributed Perl Documentation		      Spreadsheet::ParseExcel::Simple(3pm)

NAME
Spreadsheet::ParseExcel::Simple - A simple interface to Excel data SYNOPSIS
my $xls = Spreadsheet::ParseExcel::Simple->read('spreadsheet.xls'); foreach my $sheet ($xls->sheets) { while ($sheet->has_data) { my @data = $sheet->next_row; } } DESCRIPTION
This provides an abstraction to the Spreadsheet::ParseExcel module for simple reading of values. You simply loop over the sheets, and fetch rows to arrays. For anything more complex, you probably want to use Spreadsheet::ParseExcel directly. BOOK METHODS
read my $xls = Spreadsheet::ParseExcel::Simple->read('spreadsheet.xls'); This opens the spreadsheet specified for you. Returns undef if we cannot read the book. sheets @sheets = $xls->sheets; Each spreadsheet can contain one or more worksheets. This fetches them all back. You can then iterate over them, or jump straight to the one you wish to play with. book my $book = $xls->book; The Spreadsheet::ParseExcel object we are working with. You can use this if you need to manipulate it in ways that this interface doesn't allow. SHEET METHODS
These methods can be called on each sheet returned from $xls->sheets: has_data if ($sheet->has_data) { ... } This lets us know if there are more rows in this sheet that we haven't read yet. This allows us to differentiate between an empty row, and the end of the sheet. next_row my @data = $sheet->next_row; Fetch the next row of data back. sheet my $obj = $sheet->sheet; The underlying Spreadsheet::ParseExcel object for the worksheet. You can use this if you need to manipulate it in ways that this interface doesn't allow (e.g. asking it for the sheet's name). AUTHOR
Tony Bowden BUGS and QUERIES Please direct all correspondence regarding this module to: bug-Spreadsheet-ParseExcel-Simple@rt.cpan.org COPYRIGHT AND LICENSE
Copyright (C) 2001-2005 Tony Bowden. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
Spreadsheet::ParseExcel. perl v5.8.8 2008-03-12 Spreadsheet::ParseExcel::Simple(3pm)
All times are GMT -4. The time now is 02:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy