CSV to formatted document table - csv

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.

Related

can you open a excel file directly with google sheets api

how can I open a excel file directly with google sheets api
Not to my knowledge, however, using the Drive API you can upload and convert an Excel file to Sheets format automatically. This could then be used by the Sheets API. This may or may not work as a substitute in your use case.
Well you can read a .xlsx file as a binary blob from Google Apps Script API. So if you want to read the xlsx formatted file and do all the work of interpreting it yourself, then sure you can. But that's essentially writing the entire MS Excel interpreter in Google Script.

Google forms script to save responses into a csv (not excel) by default and email it as attachment

I currently have a google form which appends responses to an Excel format file. I have also attached a script to it which parses the response and emails the results...
Building on that, how would I do the following additional steps:
Keep the current behavior which appends responses to the default EXCEL spreadsheet format file.
Convert the default EXCEL spreadsheet format file to a file called allresonses.txt (CSV format)
Saves the current responses as mytest.txt (CSV format) and have this emailed as an attachment. (Currently I am able to only add them to an email using my script)
Any help would be appreciated
Thank you
The solution is to use scripts , I check the google forms script examples.
Quick walk through:
1. Just create a form in google forms and add your questions.
2. Create a script on the add script page (of course google for the correct script or check the developer forum examples)
3. While the default is a spreadsheet format you can select one of the supported types (again I check the google developer examples,they're somewhat dated but do still work.)
All sorted now.
Thank you

Is there a common html or xml spreadsheet format capable of storing functions for use between Excel and Google Sheets?

I noticed that when I exported a html spreadsheet with Google Sheets or Excel that functions were translated into literal values. Excel stores functions as Excel 2003 XML files but Google Sheets gives an error when opening such a file.
I'm looking for a human readable, html/xml file capable of storing, editing, displaying spreadsheets with functions across Excel, Google Sheets and possibly an email or webpage.
There currently is no known solution other than converting back and forth between Excel and Google Docs.

Google Form Submit > Attach New Responses to Email and Send

I have a script that turns a submitted form into a PDF and emails it automatically but I can't seem to get my head around if it is possible to implement a function i would like: -
User fills in Google form
Submits form
This creates entirely new spreadsheet based on same headers from the form
Emails thie spreadsheet as an .xlsx attachment automatically to a specific email address
Is this possible? I feel like I am missing a simple way to do this but I am having a moment of noobishness! :-)
1, 2, 3 - all quite possible.
4 - Not as such. There's no support in Google Apps Script for converting a Sheet to Excel format. However you could produce a CSV file which would be understood by Excel or any other spreadsheet program, and email that as an attachment.
Generating a CSV is covered in one of the Apps Script tutorials. See Saving a selected Range to a CSV file from Tutorial: Interacting With Your Docs List.
An example of attaching files from Drive is provided in the documentation for MailApp.sendEmail().

My requirement is to read the data from google spreadsheet, then format (apply some styles) to the data, add some images to the data and fin

google app script: I am looking for a customized pdf report using google app script. My requirement is as follows
Read data from google spreadsheet (not everything in the spreadsheet, only the required) and display as a table.
Prepare the report by merging the above spreadsheet data and some additional data (headers, images).
Apply some styles to the data.
Add images to the data.
Convert into a pdf.
Please help me.