3.2.0

load text from pipe ('|') delimited flat file

is possible change quickly the separator of data of a flat database?
ps : thanks for the great job you made
roberto
February 3,
is it possible modify the table response to use a flat db |separated in this way?
-->

table.response = function(text){
var i, s, table = [], a = text.split(/\r*\n/);
for (i=0; i<a.length; i++) {
if (a) {table[i] = a.split("|")}
}
this._data = table;
Active.HTTP.Request.prototype.response.call(this);
};
roberto
March 1,
The above code had a bug. a.split needs to be a[i].split. Here is code I am using:

table.response = function(text) {
var i, s, rows = [], a = text.split(/\r*\n/);
for (i=0; i<a.length; i++) {
if (a[i]) {
rows[i] = a[i].split("|")
}
}
this._data = rows;
Active.HTTP.Request.prototype.response.call(this);
};
Ken
March 26,
Hi I have been having the same problem with the pipe, even using the chr code for it will not work.

In the end I used a string replace function first to change the pipe to something like a comma first then it works fine, of course if you are using a comma elsewhere in the text then use something like @@ as your demiliter.

Hope that helps, it worked for me..
Gareth Shaw
October 12,

This topic is archived.

See also:


Back to support forum