By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,427 Members | 1,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,427 IT Pros & Developers. It's quick & easy.

Psycopg2 | collapse row to string

P: n/a
I'm pulling some records from a database using psycopg2, then looping
through the rows to do some data checking and then writing the results
to a file if they pass some integrity checks.

Simple enough, but...

Is there an easy want to create a delimited string from this, for
example:

for row in rows:
if checksomething == 100:
newline = row[].combine("delimiter of some kind")
resultfile.write(newline)

Obviously, the "row[].combine(delimeter)" is what I'm hoping exists.

TIA

-Jeff

This email is intended only for the individual or entity to which it is addressed. This email may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this e-mail or any attachments by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you are not the intended recipient of this message or the employee or agent responsible for delivery of this email to the intended recipient, please notify the sender by replying to this message and then delete it from your system. Any use, dissemination, distribution, or reproduction of this message by unintended recipients is strictly prohibited and may be unlawful.
Nov 21 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.