Separate Rows in reader

Dave Angel davea at davea.name
Mon Mar 25 21:40:51 EDT 2013


On 03/25/2013 09:05 PM, Jiewei Huang wrote:
 > On Monday, March 25, 2013 11:51:51 PM UTC+10, rusi wrote:

If you insist on using GoogleGroups, then make sure you keep your quotes 
small.  I'm about to stop reading messages that are double-spaced by 
buggy software.

>>> <SNIP>
>>

>>
>>
>> Have you tried the split (and perhaps strip) methods from
>>
>> http://docs.python.org/2/library/stdtypes.html#string-methods
>>
>> ?

You got lots of specific advice from your previous thread.  So which 
version did you end up using?  It'd make a good starting place for this 
"problem."



> can show me one line of how to implement it base on my problem?
>

As long as the input data is constrained not to have any embedded 
commas, just use:

     mylist = line.split(",")


instead of print, send your output to a list.  Then for each line in the 
list, fix the bracket problem to your strange specs.

     outline = outline.replace("[", "(")

-- 
-- 
DaveA



More information about the Python-list mailing list