Changeset 360 for inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py
- Timestamp:
- Oct 6, 2004, 4:34:36 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py
r355 r360 410 410 if len(lines) <= 1: 411 411 raise SyntaxError 412 lines.pop(0) #removethe first (title) line412 title = lines.pop(0) # the first (title) line 413 413 attLength = len(clean_line(lines[0],delimiter))-2 414 414 … … 444 444 xya_dict['pointlist'] = points 445 445 xya_dict['pointattributelist'] = pointattributes 446 xya_dict['title'] = title 446 447 xya_dict['segmentlist'] = [] 447 448 xya_dict['segmentmarkerlist'] = [] … … 454 455 455 456 456 def export_xya_file( file_name, xya_dict, title ):457 def export_xya_file( file_name, xya_dict, title, delimiter = ','): 457 458 """ 458 459 export a file, ofile, with the format … … 476 477 attlist = "" 477 478 for att in vertatts: 478 attlist = attlist + str(att)+" " 479 attlist = attlist + str(att)+ delimiter 480 attlist = attlist[0:-len(delimiter)] # remove the last delimiter 479 481 attlist.strip() 480 fd.write( str(vert[0]) + " "481 + str(vert[1]) + " "482 fd.write( str(vert[0]) + delimiter 483 + str(vert[1]) + delimiter 482 484 + attlist + "\n") 483 485 fd.close()
Note: See TracChangeset
for help on using the changeset viewer.