1

If I create a published table on Google sheets with a specific web address https://docs.google.com/xxxx how can I extract that information using a shell script? I have used the command

wget -O ABC.txt http://address.txt

to extract information from a webpage but it was already in .txt format. Creating another text file was straight forward. But if I use a similar command using a Google weblink it spits out all of the webpage content that doesn't matter; height, font, white-space, etc. I would like to extract the table into a txt or csv file. Has anyone done this?

Briana
  • 19
  • 1
  • 3

1 Answers1

1

Try this:

wget -O ABC.txt "https://docs.google.com/document/d/xxxxxx/export?format=txt"
Chris W.
  • 1,209
  • 1
  • 9
  • 22
  • I created a test published google sheet, which has this url: https://docs.google.com/spreadsheets/d/e/2PACX-1vRg8vvQnwJDOZbETadlJXFUKBvUNfMGGvuXfyOkQvfzEC7WeqFuufYjpKyDdoe1dNBRBPViMCJlV18K/pubhtml?gid=0&single=true – Briana Aug 28 '20 at 21:03
  • 1
    @Briana I think the sheet has to be open to the public if you want to download it with `wget`. – Chris W. Aug 28 '20 at 21:56