Hi Dave,
Thanks for the hints!
But, I have tried those already.
Here’s another hint: if I manually subdivide database down into smaller “chunks”, then it works as expected. So, I suspect the size of the array is the problem.
A text file length of “2,374,201” seems to be too long.
Question: Given an array containing the contents of a database created with arrayselectbuild() using exportlinenotabs(), is there an easy way to write “chunks” of the array to a file using file append()?
Thanks,
– Mark
P.S. here’s more of the whole script that might shed some light. The goal is to write out a CSV file with quotes around each field. Additionally, it strips out potential chr(13) and chr(10) characters embedded within fields.
// write out field header names first, as a quoted, comma-delimited string
db = sandwich('"',replace(replace(dbinfo("fields", ""),'"','""'),chr(13),chr(9)),'"')+chr(10)
filesave myfolder, myfile, "", db
// build a tab-delimited array, with chr(13) and chr(10) characters stripped out of field data
db = arrayselectedbuild(chr(10), "", {'"'+replace(replace(replace(exportlinenotabs(),chr(13),""),chr(10),""),'"','""') + '"' +chr(10)})
// convert tab, chr(9), characters to quoted commas
// *on a database with 7447 records, this "blows up" with a "Runtime error in call( procedure."*
db = arrayfilter(db, chr(10), {replace(import(),chr(9), ||","||)})
fileappend myfolder, myfile, "", db