用于将逗号分隔值拆分为行的Google脚本

时间:2015-03-30 21:19:31

标签: google-apps-script

我正在寻找一个google脚本为每个逗号分隔值创建一行,如果有多个包含逗号分隔值的列,也会创建所有可能的排列。例如:

我的表: enter image description here 我需要的是: enter image description here

有人可以帮忙吗?提前谢谢!

1 个答案:

答案 0 :(得分:0)

然后,这是你必须写的逻辑才能得到它。您必须将单元格值复制到两个不同的数组。

Function testFunc()
{

   Get the values to arrays.
   for loop for first array(for a,b values(arrayA)){
   for each value in the arrayA loop through arrayB(123) and add them in    the cells by increasing the row number eachtime.
   }
}

您可以使用str.split(',');函数将逗号分隔值转换为数组。

希望有所帮助!

相关问题