Sponsored Content
Full Discussion: A strange formula
Top Forums Shell Programming and Scripting A strange formula Post 302869587 by Akshay Hegde on Wednesday 30th of October 2013 03:11:27 PM
Old 10-30-2013
In post #7 you provided some formula. So what is your try towards that ?

Last edited by Akshay Hegde; 10-31-2013 at 01:07 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Quadratic Formula Program

I have a question about the program I am making. I finished it, compiled it, and there were no errors. Now when I run it, the comand prompt comes up and there are just 1's and 0's that keep looping over and over again. The program is listed before. If anyone has any suggestions I would greatly... (2 Replies)
Discussion started by: zeek
2 Replies

2. Shell Programming and Scripting

Help with formula in a script

I need some help. I been doing system admin for the last several years and gotten very rusty on scripting. I need to write a script that will take a log entry and do math using two columns of data to create a new column. I am taking the column(#2) that contains the time and the column(#5) that... (3 Replies)
Discussion started by: scottzx7rr
3 Replies

3. Solaris

formula to get the swap space on a machine

Hello there are different opinions on how to get the swap space on Solaris. some say: swap -s and the space= used + available others say swap -l (donno how they get the swap size) other say 'top' command others say using format command (in print sub-command) Could you please advise on... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

4. UNIX for Dummies Questions & Answers

Formula help

The formula below will calculate a distance in miles between 2 points in excel. Can some put it to work in unix? Lat = 43.335 Lon1 = -70.9884 Lat2 = 43.4829 Lon2 = -71.246 distance... (8 Replies)
Discussion started by: bobo
8 Replies

5. Shell Programming and Scripting

how to create script for this formula?

Hello Unix gurus, Can anyone tell me the most efficient way to create script for the formula? Formula: Ans = 1 - ((Buffer pool data physical reads + Buffer pool xda physical reads + Buffer pool index physical reads + Buffer pool temporary data physical reads + Buffer pool temporary xda... (6 Replies)
Discussion started by: Rahulpict
6 Replies

6. Shell Programming and Scripting

Formula to get combination… sum

Formula to get combination Lats say, I have 5 values ID Price 1 5 2 10 3 30 4 5 Resule with Possible combinations will be ID Price 1 5 2 10 3 30 4 5 1+1 10 1+2 15 1+3 35 1+4 10 (1 Reply)
Discussion started by: Amit.Sagpariya
1 Replies

7. Shell Programming and Scripting

Convert Formula to Value

I'm new to Perl, but I need to use it to write into an excel spreadsheet. I want to copy the values of certain cells into a new sheet in the workbook. I'm unsure of how to do this because I don't know how to copy values instead of formulas. Note: by formula I mean '=SUM(A1,A2)' and by value I... (0 Replies)
Discussion started by: AgentSmith88
0 Replies

8. Shell Programming and Scripting

formula missing in excel after using perl

Dear all, I got a template excel file which contains several worksheets. Each worksheet contains some formulas in the cells. I am using the perl script to read a CSV file and then put the data of CSV into template excel file(first worksheet) and then save it as new file name using ... (0 Replies)
Discussion started by: eldonlck
0 Replies

9. Shell Programming and Scripting

Formula missing in excel after using perl

Hi all, I use "Spreadsheet::ParseExcel::SaveParser" to - read a existing excel file with : $Parser = Spreadsheet::ParseExcel::SaveParser->new(); $HeaderFile = $Parser->Parse("XLS_FILE_ACCESS"); - modify some values in somes cell with : $worksheet->AddCell($row_target,$col_max,... (3 Replies)
Discussion started by: Yom
3 Replies

10. Solaris

Formula calculate scan rate

Hi There, Just curious here... If there formula to calculate scan rate on solaris? Thanks Edy (3 Replies)
Discussion started by: edydsuranta
3 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 11:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy