Link to home
Start Free TrialLog in
Avatar of vishnu kalakota
vishnu kalakota

asked on

can any one explain which is the best way to store the data from a text file into the sqlite3 data base using bash?

i have text file tried to read that file and stored in an array and tried to store in database not working properly..can any one explain how can i achieve this.

thanks
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Can you post the script you have sofar? And what error you are getting?
sqlite cli is more suiteable for your purpose.
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'd try blindly to use .import from sqlite3 CLI
could you show as an example text file.
Everything depends on the format of your text file.

Depending on it's format sqlite-cli + bash might be sufficient and best

If not I would strongly suggest to write the import script not as a bash script, but in something like python, perl
The code will be easier to write / read / maintain and both suggested languages are installed on most *nix machines
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vishnu kalakota
vishnu kalakota

ASKER

I've requested that this question be deleted for the following reason:

i have got the better sollution for this question
You cannot close the question this way. You've been given a few good suggestions on how to solve this. You should choose and award points.
You should outline your solution, using BASH preferably, as stated in initial question...