I´m trying to make a collection of scripts in php and bash that ask to bugsense for the errors in my app, make everything what I need and upload a couple of files to Google Docs so everyone in the company can see all the data up to date.
I do this because, as you know, Bugsense just gives me information of the last 30 days so I cannot store there a historical of my applications crashes.
The only problem that I´m having is how to edit a Google Spreadsheet without deleting it and uploading again. I mean, what I´m doing right now is:
google docs get $GOOGLE_DOC $GOOGLE_DOC_TSV
Now that I have the file I want to edit, I delete it from my drive because if I upload again it will not override and I will have to files with the same name:
google docs delete $GOOGLE_DOC --yes
After that I just do everything what I need with file and upload it again:
google docs upload $GOOGLE_DOC_TSV
The problem with this is that I´m having a new file everytime the script is runned so I cannot share that document because I´m deleting it everytime and uploading a new one.
The other thing that googlecl allows is to edit a file:
google docs edit $GOOGLE_DOC --format tsv --editor vim
But with this, the proccess is not automatic because you need to deal with vim. I´ve been checking everywhere about it but nothing found that solves my problem.
Finally I found how to do it looking to Python code of googlecl. What you need is to build a script that do the following:
#!/bin/bash -l
#$ -S /bin/bash
#S -N $1
export GOOGLE_DOC=$1
#!Then do whahever you need to do with the google file
This script is just taking the value of the first argument (which will be the path to the google doc that you want to edit by doing whatever with it). Then all what you need is to call to googlecl like this:
google docs edit --title GOOGLE_DOC_TITLE --format FORMAT --editor SCRIPT_WE_JUST_BUILD
GoogleCl is creating a temporary file in your system and is passing to the editor(our script) the path to that temporary file. So what we are getting is the path to the temporary file.
Whenever yoy finish googlecl will look if there is any change in that file and will upload it if YES.
Related
I have google sheets with a script included (the script is a simple function that I made to calculate something in the sheet). I want to send it to my colleague.
When I try to download it and send it or open it locally I get error msg "Unknow function".
How can I download it and send it to my colleague with the script included?
You have a couple of alternatives.
Solution 1
Create a new "demo" sheet, include the script, change permissions to Anyone with the link can edit (or view), send them the link and ask them to make a copy of it.
You could also send them just the link to it with copy instead of edit in the end of it (https://docs.google.com/spreadsheets/d/xxxxxxxxx/copy)
Solution 2
Copy the script to a simple text file (.txt) and send them the file. They can then copy/paste it using the Script editor on their sheet.
NOTE: Do not use any Word processor (like Office Word, Google Docs, etc) because they leave residue of entities that could render the code unusable.
I am learning to work on google colab. For some reason, I did cd enter.
Now when I do !pwd
output : /root
when I do: ls!
output: googleplay
This is a file I was supposed to create in another folder.
Now I am not able to figure out how to get into the folder that I have in colab.
I am trying to go to the folder called tutorial that I have in colab.
I don't know how to get to this location
This is the tree structure of my directory
-Sample_data
-tutorial
tutorial
I know these files are stored in the content folder. But how should I find path to this
%cd <directoryname>
This is a magic function to change the directory.
I believe this question was already answered here: Changing directory in Google colab (breaking out of the python interpreter)
As the thread suggests, use:
%cd DIRECTORY_NAME
I hope this will help.
Right now I have an Excel file locally in my iOS application and the file is downloaded from our own servers.
I want to be able to edit the Excel file somehow and I can't seem to get my head around how to do it with the Excel app.
I'm aware that you can't edit local files in another app like that, so I tried with links to files on my OneDrive account. I just can't seem to get the url right.
It seems like I need a direct link to the file, but all I get is a guest access link, when I make the file shareable.
Have you tried the Google Sheets app? Might do the trick.
I am trying to use pgAdmin 4 on my personal laptop (Windows operating system with PostgreSQL 9.6) to export a database as a .tar file. I had issues importing csv through the Import/Export tool as well, and could only import successfully when doing the following:
COPY public.build_info FROM 'C:\time_table.csv' CSV HEADER;
I have read a few questions that resort to backing up a database through the command line, but I am hoping to complete this within pgAdmin4.
My current steps are:
right click my database (in this case Housing_DB)
Choose my directory to save (same place the csv files were imported from)
Add additional information (encoding, file type, name, etc.)
I get an error immediately connected to Permissions, but have struggled to determine how to fix this issue:
Does anybody know how I could go through and provide permissions to be able to back up this database? I have looked at the documentation pertaining to backup/restore but did not see anything covering permissions (https://www.pgadmin.org/docs4/1.x/backup_dialog.html).
It looks like your C:\ is protected by administrator account which can't be written by user postgres. Can you try again with locations like your 'Desktop' or 'Temp' folder.
In my rails app i need to update my pricelist from another service, but trouble is in that:
how can i get archive from another site to my storage, unzip it, and do what i need (import from unziped rar archive csv file). Could anybody give idea?
This is a very broad question, but just to point you in the right direction:
Use the Net::HTTP library to retrieve the file to your system.
Use either a Ruby library capable of handling RAR files (I don't know what they are), or a command line tool like unrar (using system) to extract the archive.
Use the built-in CSV library to handle the CSV.
With all the error-handling, scheduling, and other tasks that come with such a process, this is not really something that can be fully explained in a single answer.