[Tutor] string on multiple lines

Chris Kassopulo ckasso@sprynet.com
Thu Nov 14 15:06:43 2002


On Wed, 13 Nov 2002 21:26:04 +0100
Magnus Lycka <magnus@thinkware.se> wrote:

> Ok, so it contains headings for data to follow?

Yes, I'm writing a program to track an inventory of US savings
bonds modeled after Savings Bond Wizard on windows and Gbonds
on linux.  For now I am only dealing with the csv file from
Wizard.  It will have the same heading and column layout every
time.  I verify the heading line, then iterate through each
line of the rest of the file and extract the data I need.  

> But comparing it with a string like that seems brittle.

It is, but I am not really looking for a specific solution for
this.  My interest was in the grammer of formatting a long
string so it would fit in less columns for readability and
appearance.

> Maybe you are in fact reinventing the wheel here.

Not trying to reinvent, trying to learn.

> Have a look at ASV, CSV or DSV, mentioned here:
> thinkware.se/cgi-bin/thinki.cgi/UsefulPythonModules

I will look at these.  At some point I'll go back and
generalize the import function.

> As I wrote before (I think?), you need leading and
> trailing ' on each line.
> 
>      tst_string='"Series",'\
>         '"Denomination",'\
>         '"Serial Number",'\
>         '"Issue Date"'

This must be what I was looking for.

Thank you all for the help.  Hope to return some.

Chris Kassopulo