How do i convert a csv file to a db REACT-NATIVE - react-native

I am trying to create an app that pulls and pushes to and from a remote server a bunch CSV and a txt file with data in it and convert it into a SQLLite database that I can read/write/query. The txt file contains timestamps that I will be using so when the app pulls again from the server it'll take only the updated values from the server after that certain timestamp (so I don't have to completely redownload all the data). However, I also want to be able to send data back to the server from the database!
So far, I have successfully implemented the Fetching of the data but I am stuck on how to convert my csv files into a db file for React-Native. I want to use react-native-sqlite-storage to then read/write/query the data.
However, the react-native-sqlite-storage requires a .db file and I only have .csv files.
I was thinking that I could convert the csv file into a JSON and then somehow convert the json into a db?
I'm confused whether or not my approach is efficient or is there any other efficient way to implement this ! Thank you so much

Related

SQL Trouble Importing Data from .csv file

I am importing data in my database using SQL server, through excel .csv files. I right-click on the database I'm using, tasks, import data, go through the steps of selecting the file, choosing the destination:
data source
going through the whole process, it says that all of my data has been imported successfully but when I check the table, there is no data.
Has anyone ever come across this? Or know of a reason as to why the data is not showing up in the table I have selected it to?
Thanks!

how can I get the data out of an .fb file?

I'm working with a company trying to setup a new database system as their old database software has gone out of business. All the data is in a .fb file that is encrypted (You used to have to get backups 'unlocked' before they would let you use them).
I've managed to get a copy of the database (I think it's unencrypted as I copied it while the database was open and then changed the copied files permissions using terminal).
The problem is that it's a .fb file and I can't find a way to 'open' it to browse the data...
Any Ideas?
Generally speaking, data stored in relational databases aren't just stored as ascii csv files. So you won't be able to just open up a .fb file in a text editor and grab the data.
If you're still able to query the database, you will need to have the frontbase server generate a dump of the data into a flat file.
See the frontbase documentation for backup and restore. Specifically 4.9.1. Exporting Schema and Content Data:
WRITE ALL OUTPUT('<output-directory>' [,'YES']);

.SQL export from PHPMyAdmin to Excel or CSV

I inherited some old records for a company I volunteer for. One of the old files is an SQL Dump from their old webpage, and I would like to get the data from one of the tables for their use into Excel.
-- MySQL dump 10.11
The dump drops the table if it exists, creates the table new, and then inserts all of the data.
Is there some easy way I can get this data into Excel on my PC? I don't have SQL Server or anything like that loaded... I assumed there was some easy way to get a CSV or Excel file out of it but I have failed to find this yet without first uploading the dump to some SQL Server.
Unfortunately I don't think that there is any way to export a dump file into an excel or .CSV file. The reason for this is that the dump file is actually a collection of Select statements instead of the actual data itself. SQL servers do this to prevent a whole list of problems that can occur when you try to manipulate raw data manually.
Lucky for you, MySQL offers a free version of their server. You can find it here: http://dev.mysql.com/downloads/
I think you are best off downloading this and restoring your file as a new database. This has the added benefit of allowing you complete control over the data from that point on. Exporting to excel would be easy at that point however, you may find it a lot more fulfilling to continue using MySQL server.
Hope this helped.

Trying to load CSV file into a SQL Database in the Django Shell

I am trying to import data from a CSV file into an SQL database through my Django Project. I have made my models and a separate function in Pandas that extracts the specific information that I need from the CSV file itself. I am trying to use the Django Shell to load the data from the CSV file into my database models that I created in my models.py file.
However the shell can't find the CSV file when I run my function (in pandas). How do I call in or import the CSV file from my directory into the shell? Then I'll be able to use my function to extract specific data and store it in the models I created for my SQL database.
Please help. I cannot share my scripts online for good reasons however I'd just like to know how to import a CSV file into the DJango Shell from my directory, in order to manipulate it with code. I'd also love to hear how you would import specific sets of data and store it in your classes. Does my logic of using a pandas based CSV reader function to store data into my database models sound reasonable? Is there a better way to do it?
Thank you!
-Felix

Is there a class to read in a CSV file in the build for an iPhone? [duplicate]

I have a CSV file containing data.
I want to load it into a Core Data managed sqlite db.
I just ran one of the sample Core Data Xcode apps and noticed it created the db file.
I noticed table names all started with Z and the primary keys were stored in separate table so from this am I right in presuming that just importing the CSV data directly into the db using sqlite3 command line might mess up primary keys.
Do I need to write a program to read in the CSV line by line and then create objects for each row and persist them to the db.
Anyone got any code for this?
And can I write a desktop client to do this using Core Data. If so will the db be fine to use in IPhone core data app?
Can I then just include the prefilled db in my project and it will be deployed with the app correctly or is there something else I should do.
Use NSScanner to read your CSV file into the NSManagedObject instances in your Core Data store.
I have some categories on NSString for reading and writing CSV files from/to NSArrays. I'll post them online and edit my answer with a link to it.
edit
They're online here: http://github.com/davedelong/CHCSVParser