Sponsored Content
Full Discussion: PERL excell scripting
Top Forums Shell Programming and Scripting PERL excell scripting Post 302733251 by bartus11 on Tuesday 20th of November 2012 03:40:51 AM
Old 11-20-2012
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Perl scripting

Can anyone help ..... I am prettey new to perl but would like to do the following :- write a script that would open one or more log files and select a few lines from each and create a new file with the selected lines from the logs. Thanx (4 Replies)
Discussion started by: jikyj
4 Replies

2. Shell Programming and Scripting

how to write into an Excell

Hello All, I have a query inside a shell script and it will retun a 1000 rows result set. how can i take the output into an excel file from the script for better viewing the results. Thanks, Sateesh (4 Replies)
Discussion started by: kotasateesh
4 Replies

3. Shell Programming and Scripting

Perl Scripting

Hi, I want to use the mailx command or sendmail command in perl script. I am trying this one and getting error: system "mailx -s \"Test mail\" $ar1"; Error: The flags you gave are used only when sending mail. (10 Replies)
Discussion started by: vaibhav
10 Replies

4. UNIX for Dummies Questions & Answers

From Ascii files to Excell

Hi, Is there anyway to copy a certain column from the Ascii file into a column on an Excel sheet? Thanks, (4 Replies)
Discussion started by: cosmologist
4 Replies

5. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

6. UNIX for Dummies Questions & Answers

Need help configuring Active Perl on Windows Vista.: Perl Scripting on Windows

Hi All, Need help configuring Active Perl on Windows Vista. I am trying to install Active Perl on Windows Vista. The version of Active Perl i am trying to install is : ActivePerl 5.10.1 Build 1006 After installing it through cmd, When i try to run perl -v to check the version, i get the... (2 Replies)
Discussion started by: Vabiosis
2 Replies

7. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

8. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

9. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

10. Shell Programming and Scripting

Trimmean of Excell in awk

Anyone know how we can implement excel trimmean avg in Unix. possible by AWK Sample File scr1 100 scr1 2000 scr2 320 scr1 50 scr1 10 scr2 2 scr2 220 scr1 4234 scr2 2435 scr2 2 scr3 345 scr2 356 expected Output, which was using =trimmean(scr1 values, ignore 50% of values from... (8 Replies)
Discussion started by: mychbears
8 Replies
Spreadsheet::WriteExcel::Formula(3pm)			User Contributed Perl Documentation		     Spreadsheet::WriteExcel::Formula(3pm)

NAME
Formula - A class for generating Excel formulas SYNOPSIS
See the documentation for Spreadsheet::WriteExcel DESCRIPTION
This module is used by Spreadsheet::WriteExcel. You do not need to use it directly. NOTES
The following notes are to help developers and maintainers understand the sequence of operation. They are also intended as a pro-memoria for the author. ;-) Spreadsheet::WriteExcel::Formula converts a textual representation of a formula into the pre-parsed binary format that Excel uses to store formulas. For example "1+2*3" is stored as follows: "1E 01 00 1E 02 00 1E 03 00 05 03". This string is comprised of operators and operands arranged in a reverse-Polish format. The meaning of the tokens in the above example is shown in the following table: Token Name Value 1E ptgInt 0001 (stored as 01 00) 1E ptgInt 0002 (stored as 02 00) 1E ptgInt 0003 (stored as 03 00) 05 ptgMul 03 ptgAdd The tokens and token names are defined in the "Excel Developer's Kit" from Microsoft Press. "ptg" stands for Parse ThinG (as in "That lexer can't grok it, it's a parse thang.") In general the tokens fall into two categories: operators such as "ptgMul" and operands such as "ptgInt". When the formula is evaluated by Excel the operand tokens push values onto a stack. The operator tokens then pop the required number of operands off of the stack, perform an operation and push the resulting value back onto the stack. This methodology is similar to the basic operation of a reverse-Polish (RPN) calculator. Spreadsheet::WriteExcel::Formula parses a formula using a "Parse::RecDescent" parser (at a later stage it may use a "Parse::Yapp" parser or "Parse::FastDescent"). The parser converts the textual representation of a formula into a parse tree. Thus, "1+2*3" is converted into something like the following, "e" stands for expression: e / | 1 + e / | 2 * 3 The function "_reverse_tree()" recurses down through this structure swapping the order of operators followed by operands to produce a reverse-Polish tree. In other words the formula is converted from in-fix notation to post-fix. Following the above example the resulting tree would look like this: e / | 1 e + / | 2 3 * The result of the recursion is a single array of tokens. In our example the simplified form would look like the following: (1, 2, 3, *, +) The actual return value contains some additional information to help in the secondary parsing stage: (_num, 1, _num, 2, _num, 3, ptgMul, ptgAdd, _arg, 1) The additional tokens are: Token Meaning _num The next token is a number _str The next token is a string _ref2d The next token is a 2d cell reference _ref3d The next token is a 3d cell reference _range2d The next token is a 2d range _range3d The next token is a 3d range _func The next token is a function _arg The next token is the number of args for a function _class The next token is a function name _vol The formula contains a voltile function The "_arg" token is generated for all lists but is only used for functions that take a variable number of arguments. The "_class" token indicates the start of the arguments to a function. This allows the post-processor to decide the "class" of the ref and range arguments that the function takes. The class can be reference, value or array. Since function calls can be nested, the class variable is stored on a stack in the @class array. The class of the ref or range is then read as the top element of the stack $class[-1]. When a "_func" is read it pops the class value. Certain Excel functions such as RAND() and NOW() are designated as volatile and must be recalculated by Excel every time that a cell is updated. Any formulas that contain one of these functions has a specially formatted "ptgAttr" tag prepended to it to indicate that it is volatile. A secondary parsing stage is carried out by "parse_tokens()" which converts these tokens into a binary string. For the "1+2*3" example this would give: 1E 01 00 1E 02 00 1E 03 00 05 03 This two-pass method could probably have been reduced to a single pass through the "Parse::RecDescent" parser. However, it was easier to develop and debug this way. The token values and formula values are stored in the %ptg and %functions hashes. These hashes and the parser object $parser are exposed as global data. This breaks the OO encapsulation, but means that they can be shared by several instances of Spreadsheet::WriteExcel called from the same program. Non-English function names can be added to the %functions hash using the "function_locale.pl" program in the "examples" directory of the distro. The supported languages are: German, French, Spanish, Portuguese, Dutch, Finnish, Italian and Swedish. These languages are not added by default because there are conflicts between functions names in different languages. The parser is initialised by "_init_parser()". The initialisation is delayed until the first formula is parsed. This eliminates the overhead of generating the parser in programs that are not processing formulas. (The parser should really be pre-compiled, this is to-do when the grammar stabilises). AUTHOR
John McNamara jmcnamara@cpan.org COPYRIGHT
X MM-MMX, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. perl v5.10.1 2010-02-02 Spreadsheet::WriteExcel::Formula(3pm)
All times are GMT -4. The time now is 12:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy