Psycopg2 | collapse row to string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Demel, Jeff

    Psycopg2 | collapse row to string

    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("delim iter of some kind")
    resultfile.writ e(newline)

    Obviously, the "row[].combine(delime ter)" 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.
Working...