Changeset 8139
- Timestamp:
- Mar 10, 2011, 8:39:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/lib/add_csv_header/add_csv_header.py
r6357 r8139 8 8 9 9 10 ##11 # @brief Add a header line to a text CSV file.12 # @param file Path to the file to add header to.13 # @param header_list A list of strings - the header to insert.14 # @param be_green If True, go easy on memory, but slower.15 # @note Checks that the first line of the original file has the same16 # number of fields as the new header line.17 # @note Raises exception if above is not true.18 # @note The 'be_green' option is not yet implemented.19 10 def add_csv_header(file, header_list, be_green=False): 20 '''Add a CSV header line to a text file.''' 11 """Add a CSV header line to a text file. 12 13 file Path to the file to add header to 14 header_list A list of strings - the header to insert 15 be_green If True, go easy on memory, but slower 16 17 Checks that the first line of the original file has the same number of 18 fields as the new header line. Raises exception if thi is not true. 19 20 The 'be_green' option is not yet implemented. 21 """ 21 22 22 23 # open the file to insert header into
Note: See TracChangeset
for help on using the changeset viewer.