Make a CSV editing and saving as new file, Python script
- or -
Post a project like this2352
€20(approx. $22)
- Posted:
- Proposals: 5
- Remote
- #1773203
- Completed
Description
Experience Level: Entry
Estimated project duration: 1 day or less
General information for the business: Clients IT support
Kind of development: Customization of existing program
Description of every module: Here is the code that i have written so far (with the help of StackOverflow dot com) but still havent been able to correctly add the values i want in the new row, and also to save the file as a new one.
https://stackoverflow.com/questions/46696319/how-to-edit-a-csv-in-python-and-add-one-row-after-the-2nd-row-that-will-have-the
Here you will see the code as far as it has advanced, but still needs some experienced programmer to finalize it.
Description of requirements/functionality: i want to put this *.py script in a windows folder and run it either directly or via batch and do what i need to all the *.CSV files that it will find inside that folder.
CMS and Admin requirements: Here is a *.CSV file, like the ones i plan to edit with that script.
order_id,order_number,date,status,shipping_total,shipping_tax_total,fee_total,fee_tax_total,tax_total,discount_total,order_total,refunded_total,order_currency,payment_method,shipping_method,customer_id,billing_first_name,billing_last_name,billing_company,billing_email,billing_phone,billing_address_1,billing_address_2,billing_postcode,billing_city,billing_state,billing_country,shipping_first_name,shipping_last_name,shipping_address_1,shipping_address_2,shipping_postcode,shipping_city,shipping_state,shipping_country,shipping_company,customer_note,item_id,item_product_id,item_name,item_sku,item_quantity,item_subtotal,item_subtotal_tax,item_total,item_total_tax,item_refunded,item_refunded_qty,item_meta,shipping_items,fee_items,tax_items,coupon_items,order_notes,download_permissions_granted,admin_custom_order_field:customer_type_5 15001_TEST_2,,"2017-10-09 18:53:12",processing,0,0.00,0.00,0.00,5.36,7.06,33.60,0.00,EUR,PayoneCw_PayPal,"0,00",0,name,surname,,name.surname@gmail.com,0123456789,"address 1",,41541_TEST,location,,DE,name,surname,address,01245212,14521,location,,DE,,,1328,302,"product title",103,1,35.29,6.71,28.24,5.36,0.00,0,,"id:1329|method_id:free_shipping:3|method_title:0,00|total:0.00",,id:1330|rate_id:1|code:DE-MWST-1|title:MwSt|total:5.36|compound:,"id:1331|code:#getgreengent|amount:7.06|description:Launchcoupon for friends","text string",1,
Specific technologies required: Python v.3+
OS requirements: Windows
Extra notes: I have a csv file with around 30-40 columns and 5-50 rows with various details in each cell.
The 1st row of the csv has the title for each column and by the 2nd row i have item values.
What i want to do is to create a python script which will read the csv file and every time to do the following: Add a row after the actual 1st item row, (literally after the 2nd row, cause the 1st row is titles), and in that new 3rd row to contain the same information like the above one with one difference only. in the column "item_subtotal" i want to add the value from the column "discount total". all the bellow rows should remain as they are, and save this modified csv as a new file with the word "edited" added in the file name.
Kind of development: Customization of existing program
Description of every module: Here is the code that i have written so far (with the help of StackOverflow dot com) but still havent been able to correctly add the values i want in the new row, and also to save the file as a new one.
https://stackoverflow.com/questions/46696319/how-to-edit-a-csv-in-python-and-add-one-row-after-the-2nd-row-that-will-have-the
Here you will see the code as far as it has advanced, but still needs some experienced programmer to finalize it.
Description of requirements/functionality: i want to put this *.py script in a windows folder and run it either directly or via batch and do what i need to all the *.CSV files that it will find inside that folder.
CMS and Admin requirements: Here is a *.CSV file, like the ones i plan to edit with that script.
order_id,order_number,date,status,shipping_total,shipping_tax_total,fee_total,fee_tax_total,tax_total,discount_total,order_total,refunded_total,order_currency,payment_method,shipping_method,customer_id,billing_first_name,billing_last_name,billing_company,billing_email,billing_phone,billing_address_1,billing_address_2,billing_postcode,billing_city,billing_state,billing_country,shipping_first_name,shipping_last_name,shipping_address_1,shipping_address_2,shipping_postcode,shipping_city,shipping_state,shipping_country,shipping_company,customer_note,item_id,item_product_id,item_name,item_sku,item_quantity,item_subtotal,item_subtotal_tax,item_total,item_total_tax,item_refunded,item_refunded_qty,item_meta,shipping_items,fee_items,tax_items,coupon_items,order_notes,download_permissions_granted,admin_custom_order_field:customer_type_5 15001_TEST_2,,"2017-10-09 18:53:12",processing,0,0.00,0.00,0.00,5.36,7.06,33.60,0.00,EUR,PayoneCw_PayPal,"0,00",0,name,surname,,name.surname@gmail.com,0123456789,"address 1",,41541_TEST,location,,DE,name,surname,address,01245212,14521,location,,DE,,,1328,302,"product title",103,1,35.29,6.71,28.24,5.36,0.00,0,,"id:1329|method_id:free_shipping:3|method_title:0,00|total:0.00",,id:1330|rate_id:1|code:DE-MWST-1|title:MwSt|total:5.36|compound:,"id:1331|code:#getgreengent|amount:7.06|description:Launchcoupon for friends","text string",1,
Specific technologies required: Python v.3+
OS requirements: Windows
Extra notes: I have a csv file with around 30-40 columns and 5-50 rows with various details in each cell.
The 1st row of the csv has the title for each column and by the 2nd row i have item values.
What i want to do is to create a python script which will read the csv file and every time to do the following: Add a row after the actual 1st item row, (literally after the 2nd row, cause the 1st row is titles), and in that new 3rd row to contain the same information like the above one with one difference only. in the column "item_subtotal" i want to add the value from the column "discount total". all the bellow rows should remain as they are, and save this modified csv as a new file with the word "edited" added in the file name.
Theodor D.
100% (18)Projects Completed
18
Freelancers worked with
10
Projects awarded
53%
Last project
12 Feb 2020
Germany
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies