On Wed, 24 Jan 2007 11:51:27 -0800, metaperl wrote:
> Ok, I have a module called textgen.py. The point of this module is to
> generate a csv file from an array of dictionaries.
You probably should use the csv module to do the grunt work, leaving your
module just to massage the dicts into a form t
On 2007-01-24, metaperl <[EMAIL PROTECTED]> wrote:
> if dict_key == 'PCN':
> fields = dict_val.split("/")
> mo = re.match( '(\w{2})(\d{2})(\d{2})' , fields[1] )
> if mo:
> dict_val = "%s/%s%s/%s" % (fields[0], mo.group(1),
>
metaperl a écrit :
> Ok, I have a module called textgen.py. The point of this module is to
> generate a csv file from an array of dictionaries.
Err... You know there's a csv module in the stdlib, don't you ?
> As I iterate through
> each dictionary, I "massage" the dictionary values before writin
Ok, I have a module called textgen.py. The point of this module is to
generate a csv file from an array of dictionaries. As I iterate through
each dictionary, I "massage" the dictionary values before writing them
out to csv. Now, for one dictionary entry, I have the following code:
if