Forum Discussion
DebbieSmith
8 years agoQrew Trainee
Yes I understand that it is doing what it is supposed to which is why I need a direct export to txt. The file format is a gft or gift format which is required by some eLearning programs. The extra new lines are required.
- _anomDiebolt_8 years agoQrew EliteOkay problem solved. Basically you need a custom export that conforms to GFF file format. I see some blub explaining GFF here:
http://www.ensembl.org/info/website/upload/gff.html
This may or may not be similar to CSV or TSV but it is clearly different or they would not have their own file extension.
So this is what I would do: Use script and grab all the data feilds using API_DoQuery with &fmt=structured. Then iterate through the records and fields and paste together a line of GFF. Concatenate all the lines into one blob of text.
When you have your final blob of text assembled download it as a file using the download() function in this pastie:
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=316
BTW, that pastie was used to create some custom export file that was in a format called LEDES1998 - whatever that is. It is basically the same problem you have just a different file format.
Problem solved from my perspective.
Here is the script I used to iterate through the sample records you provided which you should be able to adopt to your purposes:
var dbid = "bm64xf9ij";
var dbidTable1 = "bm64xf9ji";
var apptoken = "k7dnxfe8k6cbdthevgzchzse6y";
$.ajaxSetup({data: {apptoken: apptoken}});
$.get('${dbidTable1}?act=API_DoQuery&qid=1&fmt=structured')
.then(function(xml) {
console.dirxml(xml);
$("record", xml).each(function() {
$("f", this).each(function() {
var field = $(this).text();
console.log(field);
});
$("f", this).each(function() {
var field = $(this).text();
var letters = field.split("").map(function(letter) {
return letter.charCodeAt(0);
});
console.log(JSON.stringify(letters));
});
console.log(" ");
});
});
If you need further help with this feel free to contact me offline using the information in my profile:
https://getsatisfaction.com/people/dandiebolt - _anomDiebolt_8 years agoQrew EliteFinal note:
Apparently that is the wrong format. GFF is General Feature Format having something to do with genetics.
https://en.wikipedia.org/wiki/General_feature_format
Your format is GIFT (General Import Format Template) which is quite different:
https://en.wikipedia.org/wiki/GIFT_(file_format)
So I can see how this GIFT format is quite different and clearly requires a custom format like so://Comment line ::Question title :: Question { =A correct answer ~Wrong answer1 #A response to wrong answer1 ~Wrong answer2 #A response to wrong answer2 ~Wrong answer3 #A response to wrong answer3 ~Wrong answer4 #A response to wrong answer4 }
Anyway I put too much effort into discovering this myself so this is the limit of my forum contribution on this question.
If you need further help with this feel free to contact me offline using the information in my profile:
https://getsatisfaction.com/people/dandiebolt - DebbieSmith8 years agoQrew TraineeThank you! Yes I can have Quick Base create the right format in a field which is what I have done I just need that field to export as is to a Unicode 8 txt file.
- _anomDiebolt_8 years agoQrew EliteIt sounds like you have built up a of formula that attempt to convert individual fields of data for the question and answers into an GIFT entry and then attempting to download that formula as CSV or TSV. The problem is that QuickBase is doing the standard CSV / TSV escaping things that don't conform to GIFT format.
So would skip the formula and use a template just as was done in the LEDES1998 solution.var template = "";
It is exactly the same problem just a different format.
template += qdb_heading.join("|") + "[]\n";
template += "{{#.}}\n";
template += "{{" + _.range(22).join("}}|{{") + "}}[]\n";
template += "{{/.}}\n";
var ledes = Mustache.render(template, qdb_data);
But I can't spend any more pro bono time on this as I am working on my QuickBase ELM project that will turn all of QuickBase into one pure function evaluation.- QBAdmin14 years agoQrew Member
My problem is similar in that I have exported my data to CSV but need the output in text format. When I copy the results from CSV to a text file, "" quotations encompass my result. Any new developments or solutions on how to prevent this?
See Snippets for QB -> CSV -> Text
------------------------------
QB Admin
------------------------------