Forum Discussion
_anomDiebolt_
9 years agoQrew Elite
Like this:
=A1 & ";" & B1 & ";" & C1
=A1 & ";" & B1 & ";" & C1
_anomDiebolt_
9 years agoQrew Elite
>Dan's solution confuses me LOL!
It is very simple.
For a long time the only thing you could do with a file is upload it directly to the server unchanged. Improvements in HTML5 now allow you to read a file selected through a standard <input type=file> element using an API called the FileReader.
So you create a little form that offers the user to select the CSV file and when the file is loaded you create a FileReader object. The FileReader object is used in conjunction with D3's CSV parser (D3 is an excellent open source visualization library) to read the data in the CSV file and return it as an array of arrays like this:
The only challenging part of this process is the manipulation done with Underscore. But you can paste the code into the console from any QuickBase page and you will see that the script works as advertised.
It is very simple.
For a long time the only thing you could do with a file is upload it directly to the server unchanged. Improvements in HTML5 now allow you to read a file selected through a standard <input type=file> element using an API called the FileReader.
So you create a little form that offers the user to select the CSV file and when the file is loaded you create a FileReader object. The FileReader object is used in conjunction with D3's CSV parser (D3 is an excellent open source visualization library) to read the data in the CSV file and return it as an array of arrays like this:
var data = [ [1, "Red"],Then the script I posted then runs and converts the data into a CSV blob of data that is in the proper format for importing with API_ImportFromCSV.
[1, "Blue"],
[1, "Green"],
[1, "Yellow"],
[1, "Pink"],
[1, "Gray"],
[2, "Yellow"],
[2, "Brown"],
[2, "Red"]
];
The only challenging part of this process is the manipulation done with Underscore. But you can paste the code into the console from any QuickBase page and you will see that the script works as advertised.
var data = [ [1, "Red"],
[1, "Blue"],
[1, "Green"],
[1, "Yellow"],
[1, "Pink"],
[1, "Gray"],
[2, "Yellow"],
[2, "Brown"],
[2, "Red"]
];
var csv = _.chain(data) .groupBy(function(item) {
return item[0];
})
.reduce(function(memo, item, key) {
return memo + key + "," + _.pluck(item, 1).join(";") + "\n";
}, "")
.value();
console.log(csv);