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 Elite
Okay 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:
If you need further help with this feel free to contact me offline using the information in my profile:
https://getsatisfaction.com/people/dandiebolt
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