Sponsored Content
Top Forums Shell Programming and Scripting Perl Reading Excel sheet isssue Post 302723523 by naaj_ila on Tuesday 30th of October 2012 10:07:50 AM
Old 10-30-2012
Perl Reading Excel sheet isssue

There is a perl scriptwhich will read Excel sheet and create one file(.v) .

Code:
Excel sheet::: 
     A              B   C   D
1  cpu_dailog   2   3   4



Perl will create the file(.v) like thsi :::

Code:
assert (cpu_dailog_iso ==2) ; 
assert (cpu_dailog_reset ==3);
assert (cpu_dailog_idle ==4);

My Requirement:::
If Row1+ColumnC (Value is 3 there) is having coloured background "Blue" , then i want to add comment . like this in generated file


Code:
assert (cpu_dailog_iso ==2) ; 
//assert (cpu_dailog_reset ==3);
assert (cpu_dailog_idle ==4);

Plz guys can any body help?
There are lot of signals. Its very pain to do it manually .

Quote:
//------------------------------------------Some part of the script---------------------------//
foreach $out_port (keys (%{$design{$ip_name}{output}})) {
if ($design{$ip_name}{output}{$out_port}{"reset_sig"} eq $reset_var) {
if (defined ($design{$ip_name}{output}{$out_port}{"single"})) {
print OUTPUT_FILE (" $ip_name\_level1_PRM_$out_port\_reset : assert \($out_port === 1\'h$design{$ip_name}{output}{$out_port}{\"reset_val\"}\)",
" else if\(assert_check_reset\) \$error\(\"$ip_name\_level1_PRM_$out_port\_reset_Assertion: incorrect reset value for $out_port +++ Xcel Value = 1\'h$design{$ip_name}{output}{$out_port}{\"reset_val\"} +++ RTL Value = %h\" ,$out_port \)\;\n");
} else {
$out_port_width = (($design{$ip_name}{output}{$out_port}{"bus_high"} - $design{$ip_name}{output}{$out_port}{"bus_low"}) + 1);
print OUTPUT_FILE (" $ip_name\_level1_PRM_$out_port\_reset : assert \($out_port === $out_port_width\'h$design{$ip_name}{output}{$out_port}{\"reset_val\"}\)",
" else if\(assert_check_reset\) \$error\(\"$ip_name\_level1_PRM_$out_port\_reset_Assertion: incorrect reset value for $out_port +++ Xcel Value = $out_port_width\'h$design{$ip_name}{output}{$out_port}{\"reset_val\"} +++ RTL Value = %h\" ,$out_port \)\;\n");
};
}
};

Last edited by naaj_ila; 10-30-2012 at 11:26 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change the cell background in excel sheet using Perl

I need to change a cell in an excel sheet to different background color using perl. Please help regarding this. Thanks and Regards, Neelam G (1 Reply)
Discussion started by: gujrathinr
1 Replies

2. Shell Programming and Scripting

How to change cell background in excel sheet using perl

I need to change a cell in an excel sheet to different background color using perl.I tried SaveParse, but was unable to get it Please help regarding this. Thanks and Regards, Neelam G https://www.unix.com/images/misc/progress.gif (0 Replies)
Discussion started by: gujrathinr
0 Replies

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. Shell Programming and Scripting

Perl : to get all the hyperlinks from the xlsx sheet(hyperlinks not visible in excel sheet directly)

Hi folks, I have a requirement in perl to print all the hyperlink from the spreadsheet(xlsx). Spreadsheet contains few lines of hyperlink data (pic attached). P.S. Hyperlink is behind the data and not visible in excel sheet directly. Now using perl script I need to copy the hyperlinks in... (3 Replies)
Discussion started by: scriptscript
3 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
Excel::Template::Plus(3pm)				User Contributed Perl Documentation				Excel::Template::Plus(3pm)

NAME
Excel::Template::Plus - An extension to the Excel::Template module SYNOPSIS
use Excel::Template::Plus; my $template = Excel::Template::Plus->new( engine => 'TT', template => 'greeting.tmpl', config => { INCLUDE => [ '/templates' ] }, params => { greeting => 'Hello' } ); $template->param(location => 'World'); $template->write_file('greeting.xls'); DISCLAIMER
This is the very first release of this module, it is an idea that I and Rob Kinyon (the author of Excel::Template) had discussed many times, but never got around to doing. This is the first attempt at bring this to reality, it may change radically as it evolves, so be warned. DESCRIPTION
This module is an extension of the Excel::Template module, which allows the user to use various "engines" from which you can create Excel files through Excel::Template. The idea is to use the existing (and very solid) excel file generation code in Excel::Template, but to extend its more templatey bits with more powerful options. The only engine currently provided is the Template Toolkit engine, which replaces Excel::Template's built in template features (the LOOP, and IF constructs) with the full power of TT. This is similar to the module Excel::Template::TT, but expands on that even further to try and create a more extensive system. You can use this module to create Excel::Template-compatible XML files using one of the supported engines. For example, with the TT engine you could create a Excel::Template XML file like: <workbook> <worksheet name="[% worksheet_name %]"> [% my_cols = get_list_of_columns %] <row> [% FOR col = my_cols %] <bold><cell>[% col %]</cell></bold> [% END %] </row> [% FOR my_row = get_list_of_objects %] <row> [% FOR col = my_cols %] <cell>[% my_row.$col %]</cell> [% END %] </row> [% END %] </worksheet> </workbook> Your TT template thus creates a XML file suitable to handing over to Excel::Template for processing. Excel::Template::Plus simplifies the template-creation and handing-over process. Future engine/plans include: Pure Perl This would allow you to write you Excel::Template files using Perl itself which would then output the XML for Excel::Template to consume. This would be modeled after the recently released Template::Declare module perhaps. TT Plugins/Macros/Wrappers This is basically anything which will make the TT engine easier to write templates for. I have experimented with some of these things, but I was not happy with any of them enough to release them yet. HTML::Template Excel::Template's templating features are based on HTML::Template, but the HTML::Template plugins and other goodies are not compatible. This engine would bring those things to Excel::Template. METHODS
new (%options) This method basically serves as a factory for creating new engine instances (for which Excel::Template::Plus::TT is the only one currently). The only parameter that it requires is engine, all other parameters are passed onto the engine's constructor (see the individual docs for more details on what is required). meta Access to the metaclass. BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. ACKNOWLEDGEMENTS
This module came out of several discussions I had with Rob Kinyon. AUTHOR
Stevan Little <stevan@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2007-2010 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-05-06 Excel::Template::Plus(3pm)
All times are GMT -4. The time now is 10:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy