表单上的Google Apps脚本提交时间格式化毛刺/修复 [英] Google Apps Script on Form Submit Time Formatting Glitch/Fix
问题描述
在文本框中输入格式在Google表单中,表单提交和响应电子表格之间存在某种通信错误,或者在将表单数据发送到电子表格之前对其进行预处理。只有格式 ### ## TEXT
其中 TEXT
包含的文本字段中的数据出现故障。字符。例如: 4:15 pm
会重现毛刺,但是 4:15 pm
和 4:15 pm
不会。
结果:撇号字符被添加当它被放到电子表格的时候(例如 I 99%肯定这个毛病是由 临时修正?:真正的问题是...在开始处理时间数据之前,我该如何去除这个讨厌的撇号?我知道如何获得单元格/范围的值()。假设我有以下方式的单元格的值: 如何处理该值成 但是在Google App Scripts for Spreadsheets 我不知道该怎么做。 后脚本:这是必要的后处理这个数据我不必在语言系教授大学教师关于正确输入格式的时间格式。 感谢那些可以帮助的人! 如何将这个值处理成4:15 pm?一个简单的java Google Apps脚本使用的Javascript具有完全相同的方法。 应该会返回除第一个字符以外的所有字符。 Background: How: I suspect that this is a glitch within Google Form (submission process)/Spreadsheet, but may be part of the Date conversion utility of the Spreadsheet interface (and is an intended feature). When entering a format in a text box in Google Forms, there is some sort of communication error between the Form submit and Response Spreadsheet, or pre-processing of the Form's data before it is sent to the spreadsheet. The glitch only seems to happen for data in a text field of the format Result: An apostrophe character is added to the beginning of the string when it is put into the Spreadsheet (i.e. I'm 99% certain that the glitch is caused by the Temporary Fix?: The real question is... how might I go about removing that pesky apostrophe before I start manipulating the time data? I know how to getValue() of a cell/Range. Assume I have the value of a cell in the following manner: How can I go about processing that value into But in Google App Scripts for Spreadsheets, I don't know how I would do that. Post-Script: It is necessary to post-process this data so that I don't have to lecture university faculty in the language department about inputting time format correctly in their forms. Thanks in advance to those who can help! How can I go about processing that value into 4:15 pm? A simple java
function could be value = value.substring(1); // Assuming "value" is a String But in
Google App Scripts for Spreadsheets, I don't know how I would do that. Google Apps Scripts uses Javascript which has the exact same method. should return all except the first character. More about Javascript substring at: http://www.w3schools.com/jsref/jsref_substring.asp 这篇关于表单上的Google Apps脚本提交时间格式化毛刺/修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!'4:15 pm
),它会抛出几个使用那个时间数据的子系统。这里有两个截图(对不起,第二个错误的大小):
##:
组合造成的。
var value = myRange.getValue();
// value ='4:15 pm
4:15 pm
?一个简单的java函数可以是
pre $ value $ value.substring(1); //假设value是一个字符串
函数可以是
value = value.substring(1); //假设value是一个字符串,但是在
Google App Scripts for Spreadsheets中,我不知道该如何做。
value = value.substring(1);
<有关Javascript子串的更多信息,请访问: http://www.w3schools.com/jsref/jsref_substring.asp ##:## TEXT
where TEXT
contains no '.' characters. For example: 4:15 pm
will reproduce the glitch, but 4:15 p.m
and 4:15 p.m.
will not.'4:15 pm
) which throws off several sub-systems I have in place that use that time data. Here are two screenshots (sorry for the bad sizing on the second):##:
combination.var value = myRange.getValue();
// value = '4:15 pm
4:15 pm
? A simple java function could bevalue = value.substring(1); // Assuming "value" is a String
value = value.substring(1);