Import from file on forms

Kelly Burgess kellyb at montana.com
Sun Jul 24 08:51:37 UTC 2022


Hi Das,

>The problem is that File puts the file into a binary field. I need it in a list for importing. 

If I were to use ReadBinFile to pull a text file into a binary field, I could generally recover that text with

   Calculate fileText as utf8tochar(fileBinary)

Exceptions would be extended characters (>ascii127) that are in single-byte form in the original file rather than in 2-byte utf8.  Those could be misinterpreted by utf8tochar(), and I might try using uniconv() to see if it would help, or I might post-process the string and special case all of the misinterpreted characters, or I might try using FileOps to read characters - but that last one's not an option if you need to use File in a remote form - unless you can get a path from File and then re-read it with FileOps.

I'm not sure what a "text spreadsheet" is, but File / ReadBinFile + utf8tochar() won't work if the source file is more than text, i.e. if it has embedded formatting specs (non-printing data), offsets to other bits of text, etc.

Kelly


More information about the omnisdev-en mailing list