Rev | Line | |
---|
[5194] | 1 | import os |
---|
| 2 | import sys |
---|
| 3 | |
---|
| 4 | os.chdir('Y:/data/sw_pacific/tonga/anuga/topographies') |
---|
| 5 | |
---|
| 6 | polyline_file=open('topography_tongatapu.txt','r') |
---|
| 7 | lines=polyline_file.readlines() |
---|
| 8 | polyline_file.close() |
---|
| 9 | |
---|
| 10 | filetoedit= open('topography_tongatapu1.txt','w') |
---|
| 11 | q= 'easting,northing,elevation\n' |
---|
| 12 | filetoedit.write(q) |
---|
| 13 | for line in lines [0:]: |
---|
| 14 | field = line.split('\t') |
---|
| 15 | x= float(field[0]) |
---|
| 16 | y=float(field[1]) |
---|
| 17 | z=float(field[2]) |
---|
| 18 | s= '%f,%f,%f\n' %(x,y,z) |
---|
| 19 | filetoedit.write(s) |
---|
| 20 | |
---|
| 21 | filetoedit.close() |
---|
Note: See
TracBrowser
for help on using the repository browser.