How to populate a formatted document table with data from CSV?
I have a CSV (data) in Google Sheets and I want to convert it to a formatted Google Docs (style).
Google Docs is preferable for it's integrability with the Google Sheets (CSV), but solutions with .docx, .pdf are ok.
Example: input --> output
More background and research
This's similar to Microsoft Access reports. I know I can paste the CSV table from Google Sheets to Google Docs, but the style is always messed up. If I use paste values only using Ctrl-Shift-V, then it pastes values separated by tabs not a table.
A possible workaround is to convert CSV to gsheets, format the spreadsheet, and paste it with its styles in google docs, but it's impractical for multiple CSV files.
Please help me out I want to write a script in puppeteer that can Read data (image url's/path) from CSV file and can pass data to some other website to auto filling/submitting forms.
Note: I want to write down a script which can read the Images URL's from the CSV and can upload those on some site form means images will be uploaded by puppeteer script is this doable? Please guide me I need your help on this.
Thanks in Advance...
We have some marketing software that pulls reports on email marketing and uploads a CSV automatically every week or month into our Google Drive. Our reporting software can't automatically pull data from a CSV, so I have to use Google Sheets.
How can I make it so that when a new CSV is uploaded onto the Drive (replacing the old CSV in the process), my Google Sheet will pull the new data and replace it over the old data?
The question isn't clear, meaning there are many "variables" to your question, and thus a variety of solutions which you can implement to solve the specific permutation you're looking for. But I'll try to answer your question with some considerations and suggestions:
"[A] new CSV is uploaded onto the Drive (replacing the old CSV in the process)." Are you sure this is happening? Every time you upload, say a hello.csv to Drive, it adds a new hello.csv file one rather than replacing an existing one with the same name. You would have to have an application that knows or can look up the original CSV Drive file ID and explicitly replace the file contents or upload a new version of that file.
If you do replace the original file via one of those two techniques, track the changes to that file via the Drive API, meaning your app can take action as soon as that file has been updated. See this page in the docs to learn how to detect changes.
The comment in the OP makes a suggestion from another SO Q&A, however that solution does not address the OP's question. Instead, it imports a CSV file to Google Drive as a Google Sheets (file) -- the CSV file never makes it to Drive as per the OP. Also, the OP is requesting something more than a mere import.
However, with that said, the OP's final request was: "[My] Google Sheet will pull the new data and replace it over the old data." There are 2 ways to do this:
a) The simplest/easiest way is to just overwrite all existing data in the Sheet with what's in the CSV file... old data, new data, it doesn't matter. Once the new CSV file has been imported and new Sheets file created, you can delete both the old CSV and corresponding Sheet. The (new) files can have the same names as their predecessors no problem. For that, build a solution similar to the SO Q&A mentioned above -- the CSV file will already be in Drive, so just create a new Sheets file and use the content from the CSV file on Drive (rather than from the local filesystem).
b) If you only want the deltas, you need to keep a copy of the old CSV and "diff" it with the new CSV, and only overwrite the rows that have changed, a much more complex solution, and one in which you'll have to use the Google Sheets API (because it's for spreadsheet operations while the Drive API is used for file operations).
I have followed the code from How to automatically import data from uploaded CSV or XLS file into Google Sheets, but it does not explain how to find the folder ID that the file has been uploaded to.
I need to provide a spreadsheet template for multiple users that will facilitate the identification of the folder, since I have no way of knowing for sure where each user will save the csv file. I wish to avoid mistakes identifying the destination folder.
How can I obtain the ID of the folder where the user is importing their data?
Once you export all of the data you need from MySQL into an Excel spreadsheet using PHP Excel, is it possible to call an existing Excel macro to apply formats to the data? If so could you provide an example, please?