$O6 - file import problem

brian at revolution911.com brian at revolution911.com
Sat Dec 21 11:55:14 EST 2013


Hi Mischa,

I had to do something like this to get mine to work.  Don't know if it will work for yours.  

Do iFileOps.$createfile(%%filelocation)
Do iFileOps.$openfile(%%filelocation) Returns %%status
Calculate lList2.$line as 1
Repeat
Calculate lBinary as con(lBinary,lList2.[lList2.$line].iExportField,chr(13),chr(10),)
Else
Calculate lBinary as con(lList2.[lList2.$line].iExportField,chr(13),chr(10),lBinary)
End If
Calculate lList2.$line as lList2.$line+1
Until lList2.$line>lList2.$linecount
Do iFileOps.$writefile(chartoutf8(lBinary))
Do iFileOps.$closefile

Do method ExelPayData (pDate,pUserDept,lList) Returns %%filelocation
Do ToListBline.$define(%%email)
Do ToListBline.$add('brian at myemail.com')
Do ToList.$define(%%email)
Do ToList.$add('tom at myemail.com')
Calculate LclientEmail as 'brian at wayne-enterprises.net'
Do LmimeList.$define(Llevel,LcontentType,LcontentSubType,lFileName,LcharData,LbinData,LcharSet,Lencoding)
Do LmimeList.$add(0,'multipart','mixed','','',#NULL,'','')
Do LmimeList.$add(3,'text','plain','',LpvBodyText,#NULL,'','')     ;; Body section go here
Do LxtraHdrList.$define(LxtraHdr1,LxtraHdr2)
Do LxtraHdrList.$add('Reply-To','brian at myemail.com')
Do FileOps.$readentirefile(%%filelocation,LpvPDFdata)
Do LmimeList.$add(1,'application','CSV','ExcelPCHOURS.CSV','',LpvPDFdata,'','base64')     ;; any visible attachments go here

-----Original Message-----
From: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Mischa
Sent: Saturday, December 21, 2013 7:01 AM
To: 'OmnisDev List - English'
Subject: $O6 - file import problem

Dear all,

I want to import a csv file into Studio 6, however having trouble with the encoding. Its native format is UTF-8, however 'Read file as character' results in a strange looking Thai or Chinese character set when imported.  $root.$prefs.$importencoding is set to kUniTypeUTF8

When I convert the csv file to ANSI and try to import it (encoding set to AnsiCentralEuropean) Omnis crashes.

Any help would be greatly appreciated!
Mischa


_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list