Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

# read and write a csv file

# read Rows from CSV File
import csv
def read_csv_file(filename):
    with open(filename, encoding='utf-8', newline='') as file:
        return list(csv.reader(file))
      
# write Rows to CSV File
def write_to_csv_file(filename, rows):
    with open(filename, 'w', encoding='utf-8', newline='') as file:
        writer = csv.writer(file)
        writer.writerows(rows)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #write #csv #file
ADD COMMENT
Topic
Name
3+6 =