For example, I have a Google Spreadsheet here:
https://docs.google.com/spreadsheet/pub?key=0Aumm3V3g3dF7dFR6eWRJQjE0UHJpdU8yVTlxb2hUMFE
I want to open it in R or select some of columns in bash. Here are the tips for that:
Step1: publish the tab you want to access to the web [howto], in format of CVS or TXT (which is a tab-delimited file actually)
Step3: To access the file externally. Done.
For example, to access the 1st and 3rd columns in bash:
wget --no-check-certificate -q -O - 'https://docs.google.com/spreadsheet/pub?key=0Aumm3V3g3dF7dFR6eWRJQjE0UHJpdU8yVTlxb2hUMFE&single=true&gid=0&output=txt' | cut -f1,3
or
curl -s 'https://docs.google.com/spreadsheet/pub?key=0Aumm3V3g3dF7dFR6eWRJQjE0UHJpdU8yVTlxb2hUMFE&single=true&gid=0&output=txt'
Note: the quote on the URL is a must.
In R,
myURL="https://docs.google.com/spreadsheet/pub?key=0Aumm3V3g3dF7dFR6eWRJQjE0UHJpdU8yVTlxb2hUMFE&gid=0&output=tsv"
require(RCurl)
myTable=read.delim(textConnection(getURL(myURL)))
Note: the above code still works as a simple solution. Just note that Google has changed the txt into tsv, as I highlighted above (2016-Feb-2)
