How to import CSV files into Firebase
Asked Answered
A

5

8

I see we can import json files into firebase.

What I would like to know is if there is a way to import CSV files (I have files that could have about 50K or even more records with about 10 columns). Does it even make sense to have such files in firebase ?

Allbee answered 26/11, 2015 at 5:0 Comment(1)
I think more data is needed to properly answer the question: Do you want to store an existing CSV file as an entity in firebase so it can be downloaded later? Or do you want to parse the CSV file and store it's separate components in firebase? What's the use case?Fried
S
5

I can't answer if it make sense to have such files in Firebase, you should answer that.

I also had to upload CSV files to Firebase and I finally transformed my CSV into JSON and used firebase-import to add my Json into Firebase.

there's a lot of CSV to JSON converters (even online ones). You can pick the one you like the most (I personnaly used node-csvtojson).

Sateen answered 26/11, 2015 at 7:40 Comment(1)
How about new Firebase version? I noted that : test.firebaseio-demo.com (example link on your Github reference) isn't available now. Google changed it.Alys
M
3

One trick I used on top of all the one already mentioned is to synchronize a google spreadsheet with firebase.

You create a script that upload directly to firebase db base on row / columns. It worked quite well and can be more visual for fine tuning the raw data compared to csv/json format directly.

Ref: https://www.sohamkamani.com/blog/2017/03/09/sync-data-between-google-sheets-and-firebase/

Misinterpret answered 30/11, 2017 at 19:33 Comment(0)
N
1

I've uploaded many files (tab separated files) (40MB each) into firebase. Here are the steps:

  1. I wrote a Java code to translate TSV into JSON files.
  2. I used firebase-import to upload them. To install just type in cmd:

npm install firebase-import

Natheless answered 12/12, 2016 at 9:4 Comment(0)
A
1

Here is the fastest way to Import your CSV to Firestore:

  1. Create an account in Jet Admin
  2. Connect Firebase as a DataSource
  3. Import CSV to Firestore

Ref: https://blog.jetadmin.io/how-to-import-csv-to-firestore-database-without-code/

Agnomen answered 2/1, 2023 at 9:35 Comment(0)
L
0

Here is the fastest and very comfortable tools to Import your CSV/json to Firestore and export firestore to csv/json.

https://firefoo.app/docs/firestore-export-import/export-csv

Like answered 10/8, 2023 at 19:39 Comment(1)
any affiliation? /help/promotionShopper

© 2022 - 2024 — McMap. All rights reserved.