On Tuesday, December 29, 2015 at 2:41:22 PM UTC-5, Jordan Clark wrote:
>
> Hey,
>
> I'm posting data from a form to google sheets, the only problem is when 
> people copy/paste fields from other word programs.
>
> Take this title for example: 
> 1. It’s been a big year for growth-stage investment in Waterloo Region. 
> Match these companies’ names to the amounts raised. (Use each amount only 
> once)
>
> Encoding has Microsofts special quote character etc.  Also in between 1. 
> and It's, is a tab, which I change to space because sheets doesn't enjoy \t
>
> So from this text, I've crafted the header from the regex:
>
> re.compile(r'[^a-zA-Z0-9\-]+')
>
> So the entry looks like this:
>
> <entry xmlns="http://www.w3.org/2005/Atom"; xmlns:gsx="
> http://schemas.google.com/spreadsheets/2006/extended";>
>   
> <gsx:1itsbeenabigyearforgrowth-stageinvestmentinwaterlooregionmatchthesecompaniesnamestotheamountsraiseduseeachamountonlyonce>
>     test
>   
> </gsx:1itsbeenabigyearforgrowth-stageinvestmentinwaterlooregionmatchthesecompaniesnamestotheamountsraiseduseeachamountonlyonce>
> </entry>
>
>
>
> Still it doesn't pick up the cell.  I get a 400 error saying: "Blank rows 
> cannot be written; use delete instead."
>
>
> The header within the spreadsheet is as follows:
>
>
> 1. It’s been a big year for growth-stage investment in Waterloo Region. 
> Match these companies’ names to the amounts raised. (Use each amount only 
> once)
>
>
> Are there docs available saying what the headers regex out / morph into? 
>  Where can I find them so I can format this string correctly.
>
>
> Thanks in advance,
>
> Jordan
>

Okay so I've found the answer, although it's not in any of the docs.

I'm correctly parsing the string, EXCEPT if a header BEGINS with a number, 
that number is then taken out, but if there is a letter and then a number, 
the number stays in.  So for this example, posting to the header would 
actually be:

<entry xmlns="http://www.w3.org/2005/Atom"; xmlns:gsx="http://schemas.
google.com/spreadsheets/2006/extended">
  <gsx:itsbeenabigyearforgrowth-stageinvestmentinwaterlooregio
nmatchthesecompaniesnamestotheamountsraiseduseeachamountonlyonce>
    test
  </gsx:itsbeenabigyearforgrowth-stageinvestmentinwaterlooregio
nmatchthesecompaniesnamestotheamountsraiseduseeachamountonlyonce>
</entry>


Jordan

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to