# HG changeset patch # User Henry S. Thompson # Date 1494952039 -3600 # Node ID 793496d2d165d2333954cdff5522e0fcb00ebcb6 # Parent 01a7c2ebd3d1518481566ceeace310c42299ebcf allow command line input diff -r 01a7c2ebd3d1 -r 793496d2d165 parse.py --- a/parse.py Thu May 11 09:29:33 2017 +0100 +++ b/parse.py Tue May 16 17:27:19 2017 +0100 @@ -1,3 +1,4 @@ +#!/usr/bin/python2.7 ''' Tokenise Excel formulae Starting from regexps and concat rules in https://sites.google.com/site/e90e50/random-topics/tool-for-parsing-formulas-in-excel @@ -50,6 +51,9 @@ f="""=IF(I$1>$C$2,VLOOKUP($C52,GP_input!$C$187:$CM$196,VLOOKUP($C$9,lists!$A$34:$B$39,2,FALSE)+BC$4,FALSE),SUMIF('BEX2011'!$C$32:$C$5000,$B$9&"sl"&$B52&$C52&$B53,'BEX2001'!Q$32))""" +if len(sys.argv)>1: + f=sys.argv[1] + l=tokPat.findall(f) ## Visual basic code: