baskara8
(Riva Ananta Baskara)
August 26, 2017, 4:21pm
1
Now, my problem is when I import data form excel sheet to the database in particular format. Like,
Table name:-Mytable
id | name | surname | email | date |
and the excel file I am using to import have a same format. But a format can change Like,
id | surname | name | date | email |
how can I map the columns from excel file to the database table so that correct data should enter into the data table.
calmh
(Jakob Borg)
August 26, 2017, 4:34pm
2
Typically the first row would hold the column names. You read that and parse the remaining rows accordingly. Parse into a slice of struct, for example, and then handle those appropriately in the database layer.
baskara8
(Riva Ananta Baskara)
August 26, 2017, 4:42pm
3
Would you please provide sample code?
calmh
(Jakob Borg)
August 26, 2017, 4:57pm
4
Why don’t you show what you have and where you run into trouble, and we can offer advice on how to proceed.
4 Likes
system
(system)
Closed
November 24, 2017, 4:57pm
5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.