AnsweredAssumed Answered

Find and replace blanks in CSV with python

Question asked by huaorani on Dec 14, 2010
Latest reply on Dec 20, 2010 by huaorani
Hi,
I have a csv with some blanks that I want to convert to a value of N so I can import into a database.  Can someone tell me what I'm doing wrong in my code?

Thanks.

import fileinput
for line in fileinput.FileInput(OPS_frq,inplace=1):
    line = line.replace(" ","N")
    print line


The csv looks like this:
GEOKEY,INDIG,CAVE,CORR,EYPT,PSP,LIC,HERIT,WELLS,TS,TT
1,,,,,,,,,,
2,,,,
3,,,,Y
4
5

Outcomes