Hello everyone,
I need some help, I would like to merge two cells together within a row only (e.g) in a CSV file using python.
So far, I have 4 columns in the file, but now I would like to merge two cells in one, but I don't have any clue how to do it.
Can someone help me please? Thank you
I used the code below to write in the file.
print "write in file"
fobj = open(rawPathOutput, "w")
outputLine = "%s;%s;%s;%s " % ( "Section",
"Points",
"Lines",
"Polygon" )
fobj.write(outputLine + "\n")
for row in range(iRows):
for col in range(iCols):
if inputWU!=0 :
pos = p
else:
#position of the partition in the map
pos = "("+str(row+1)+","+str(col+1)+")"
position = row*iCols + col
outputLine = "%s;%s;%s;%s " % (pos,
valueTable.getValue(position, 0),
valueTable.getValue(position, 1),
valueTable.getValue(position, 2))
print outputLine
fobj.write(outputLine + "\n")
fobj.close()