Timeline for A script to take data from csv file and perform related operations in a database
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 14, 2016 at 5:34 | comment | added | cas | My advice is to NOT use shell for this...but if you really want some examples of using mysql from a shell script, you could look at my mythtv scripts on github. They show how to build up SQL commands (with optional WHERE etc clauses), how to execute them, how to extract data from mysql, etc. | |
| Jul 14, 2016 at 5:32 | comment | added | cas | @DopeGhoti answered with how to do it in a shell script. Which is about as good as you're going to get with shell and there's nothing I want to add to it. My answer was focused on using existing programming libraries to do the job properly (because parsing CSV correctly or working with a database is NOT something that needs to be or should be reinvented). I wanted an answer to point at the next time someone asks "How can I import a CSV file into mysql". | |
| Jul 14, 2016 at 4:07 | comment | added | itp dusra | Thanks a lot . But could you tell me how to do it with shell scripting ? My requirement is to have a shell script that does this. Looking forward to your reply.. | |
| Jul 13, 2016 at 21:04 | history | edited | cas | CC BY-SA 3.0 |
improved comments.
|
| Jul 13, 2016 at 11:01 | history | edited | cas | CC BY-SA 3.0 |
added transaction start and end, and clean finish/disconnect.
|
| Jul 13, 2016 at 10:39 | history | answered | cas | CC BY-SA 3.0 |