fancy code reviewing some python ?
Posted by spuddy (Jon Johnson), 1 March 2005I am developing a utility which will be put out under GPL to take an SPSS (a widely used stats package) data file and produce XML and some other outputs There are a number of bits of software which do this already, but they all suffer from limitations and require all sorts of hacks and mucking about and none are as comprehensive as this is going to be (even if it kills me) So I thought I'd do it properly
The data file consists of
1. a header which contains a schema describing the data
2. the data itself
The file is in a rather odd format to me, although it may be familiar to FORTRAN programmers (SPSS is written in FORTRAN)
It also uses a variant of base 30 to encode all numbers,
80 chars wide
it is sort of / delimited, except where there are strings which have the length of the string before the /
21/Description of column7/another/99/abcdefghi/
Description of column
I put the schema into a structure and then add data to each element of the structure
I am reasonably happy with the code, but being the lone (Python) coder here I lack feekback and would appreciate any comments
I have used Mertz' state machine pattern to drive the code
it is only 400 lines or so for the main code and you'll get properly credited when i release it.
If you're interested please get in touch at
Posted by admin (Graham Ellis), 2 March 2005Jon, I fancy reviewing the code but I don't have enough hours in the day to do everything I fancy. You're welcome to get in touch further (by personal message on this board or by email) if you would like to send me a copy ... I can promise you up to half an hour within the next 2 weeks to look at it.
Posted by rob_cowie (rob_cowie), 13 April 2005Hi,
I'm a Python newbie but I'd love to have a look at your code...more for my benefit really.
I want to create a quick script to parse an SPSS datafile, locate a field called PCODE and remove all spaces in it's string.
I assume this can be accomplished in SPSS but I can't find where... and the python script might take me less time than fumbling around SPSS in the dark.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho