text file import and encoding -
06-07-2004
, 08:36 AM
I need to import a fixed-width text file, but I encounter a problem with SQL Server DTS.
The text file definition is based on characters numbers, whereas the fields are defined on a number of bytes.
Unfortunately, some fields possess a mix of double-bytes and single-bytes characters which means I cannot create a proper import rules.
I thought of first converting the text file with an ActiveX task, but VBScript lack of many features (I can manage it easily with Access and the VBA strConv(s, vbFrom Unicode) function, but it doesn't exist in VBScript). The problem is internally, all characters seems to be converted to Unicode, so a Lenb on each characters returns 2.
As I lack of options within DTS, I thought about compiling a little exe, and call it from DTS, but to do this would be less simple to maintain for the future, so I am wondering if anyone has a better idea.
Thanks in advance for any good ides
Regards |