Formatting Results so that They Can be Nicely Imported into a Spreadsheet.

SMERSH009 SMERSH009X at gmail.com
Sat Aug 4 19:35:55 EDT 2007


Hi All.
Let's say I have some badly formatted text called doc:


doc=
"""
friendid
Female

			    23 years old

			    Los Gatos

			    United States
friendid
Male

			    24 years old

			    San Francisco, California

			    United States
"""

How would I get these results to be displayed in a format similar to:
friendid;Female;23 years old;Los Gatos;United States
friendid;Male; 24 years old;San Francisco, California;United States


The latter is a lot easier to organize and can be quickly imported
into Excel's column format.

Thanks Much,
Sam




More information about the Python-list mailing list