Python Forum
.csv export, map and create new .csv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.csv export, map and create new .csv
#3
yes, that's relatively easy to do.
1. Create the mapping
2. For reading/writing csv files use csv module (and in particular csv.DictReader and csv.DictWriter, because of the mapping)
3. Transfer/populate the result file using the input file and derivative values (i.e. recipient_type)

So, now the devil is in the details and mostly will depend on the specifications for the result file. Do you have perfect mapping (i.e. extra/missing data)? Any difference in specifications (e.g. limited length for some fields, forbidden chars, etc.)? It depends what extra functionality you want - e.g. keep mapping as separate config file for easy manipulation, GUI/CLI interface, etc...
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
.csv export, map and create new .csv - by jtouchais - Jun-07-2018, 08:06 AM
RE: .csv export, map and create new .csv - by buran - Jun-07-2018, 08:20 AM
RE: .csv export, map and create new .csv - by buran - Jun-07-2018, 08:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to create synonyms of a word and export them to csv in different columns vijaymadhu 1 3,097 Jun-23-2017, 06:31 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020