Created
June 27, 2020 17:55
-
-
Save randylubin/084ee083dcb57744ca2d4e3b96193beb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
all_orders = [[ | |
'Name', | |
'Shipping Tracking' | |
]] | |
with open('orders.csv', 'rU') as f: | |
reader = csv.DictReader(f) | |
for row in reader: | |
order = [] | |
# save row | |
order.append(row['Name']) | |
order.append(row['Shipping Tracking']) | |
all_orders.append(order) | |
# Export | |
with open("order-tracking.csv", "wb") as sf: | |
writer = csv.writer(sf) | |
writer.writerows(all_orders) | |
print all_orders |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment