2015-03-30 76 views
-2

我正在寻找一个谷歌脚本来为每个逗号分隔值创建一行,并且如果有多个包含逗号分隔值的列,也创建所有可能的排列。例如:谷歌脚本将逗号分隔值拆分成行

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

谁能帮助?先谢谢你!

+1

如果您正在寻找脚本,请搜索interwebs,如果您希望有人为您编写脚本,请聘请程序员,如果您被困在代码的某些部分中,尝试了很多并且无法制作它的工作,向我们展示snippert,我们会在这方面提供帮助。 – Kriggs 2015-03-30 23:35:23

回答

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(',');函数将逗号分隔值转为数组。

希望有帮助!