Code Pages For Building Text Files?

  • Active Directory requires a very specific text file format (structure of data within file) for an import file I am building using SSIS. I've got a working version of the file - that was created by hand - that I now have SSIS mimicking exactly. Unfortunately, the file cannot be read by AD.

    I essentially build a single SQL string with all CR's and LF's I need by using CHAR(13) and CHAR(10), and then have SSIS break up the string into columns/rows based on the control characters while building the flat file. To the naked eye, my working file and the SSIS created file look identical in notepad - but AD can't read my SSIS created file.

    AD requires that the file be a standard windows/dos formatted file. In SSIS I only have very specific code pages (right now I am using 1252). Does anyone have any suggestions on how to view the actual control characters in both files, or what code page to use to mimick the typical windows/dos text file?

    Thanks in advance. RH

  • Some random ideas...

    I use DOS debug.com to view small text files, eg debug myfile.txt

    D - dumps next page of memory

    Q - quit

    Was messing around trying to get SSIS to read £ signs properly

    Ended up scripting as usual and found various text encodings. ASCII, UNC, etc

    If you import System.IO and System.Text you can do

    Dim objIn As StreamReader

    Dim objOut As StreamWriter

    objIn = New StreamReader(sIn, Encoding.ASCII)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply