source: anuga_work/production/new_south_wales/batemans_bay/extract_from_csv.py @ 7369

Last change on this file since 7369 was 6439, checked in by jgriffin, 15 years ago

file to read csv and extract wanted columns

File size: 737 bytes
Line 
1"""Script to read large csv files (larger than can be read in Excel)
2and extract the wanted columns
3"""
4
5import csv
6##input csv
7reader = csv.reader(open("/nas/gemd/georisk_models/inundation/data/new_south_wales/batemans_bay_tsunami_scenario_2009/elevation_final/points/SD100031996_batemans_mga_clip_jgriffin_clip.csv", "r"))
8##new csv to write desired columns to
9writer = csv.writer(open("/nas/gemd/georisk_models/inundation/data/new_south_wales/batemans_bay_tsunami_scenario_2009/elevation_final/points/SD100031996_batemans_mga_clip_jgriffin_clip_written.csv","w"))
10
11#enter the column number for desired columns (remember to start couting from 0 in python)
12for row in reader:
13    writer.writerow((row[2], row[3],row[4]))
14
Note: See TracBrowser for help on using the repository browser.