Make a CSV Importer for Google Sheets that lets users drag and drop CSV files onto the Google Sheet. The moment they drop the CSV file, allow them to select which columns to import ๐๏ธ.
The approach to this problem is that we can write the logic for getting the CSV file (i.e getting the input as a file) which when uploaded, directly gets appended to the current active spreadsheet. Now to implement the backend of the part, we can do it in two ways :-
- Utilize Google-APIs, via Nodejs OR Javascrip OR Python to write the code in the local where data can be read and dumped. We can upload the CSV file by specifying the spreadsheetID in which CSV has to be uploaded. Before uploading, we can for taking only specific columns too.
- We can open a new Spreadsheet, Navigate to Extensions and Open Appscrips, we can create a new .gs file write the logic for uploading the data in the specified format.
Refer to the below documentation to connect Google-APIs smoothly with the spreadsheets
https://www.notion.so/Uploading-CSV-file-to-Google-Spreadsheet-66758525d4ac41198944f980e2d7da4c
-
Create a new Folder
-
Download the project files
git clone [email protected]:Iamayushgupta/CSV-Uploader.git
-
Install npm package manager
npm init -y
-
Install the dependencies
npm install
-
Create a new Spreadsheet and add it's ID in the code
-
Create credentials.json and after authentication token.json will be dowloaded to access refresh token
-
Put the CSV file path which you want to be added