Re: specifying a non printable ascii value as the field terminator

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mark (anonymous_at_discussions.microsoft.com)
Date: 07/28/04

  • Next message: Peter Yeoh: "Re: SQL Profiler advise needed"
    Date: Wed, 28 Jul 2004 12:51:51 -0700
    
    

    The only non-printable characters are the field and row
    terminators themselves. Everything else is regular ascii
    characters. The import works fine also with the sample I
    showed, I just want to be able to change the blocks to
    something that is easier to read.

    >-----Original Message-----
    >Mark,
    >
    > Even if you could specify it (which I don't think you
    can), I wouldn't
    >recommend trying to import a "text" file with
    nonprinting characters - it's
    >basically not a text file and might not be handled
    correctly. You would be
    >better off running the file through some utility to
    replace the terminators
    >with something else - hopefully there is some printing
    character that is not
    >in your file (and you could use a similar utility to
    find out). I've found
    >the Cygwin open source Unix shell for Windows to be an
    excellent tool for
    >this kind of thing.
    >
    >Steve Kass
    >Drew University
    >
    >"Mark G." <anonymous@discussions.microsoft.com> wrote in
    message
    >news:545601c4741e$0774c2f0$a301280a@phx.gbl...
    >I am trying to execute the following:
    >
    >BULK INSERT mytable FROM 'C:\mydata.txt'
    >WITH (
    > DATAFILETYPE = 'char',
    > FIELDTERMINATOR = '',
    > ROWTERMINATOR = ''
    >)
    >
    >The field terminator is ascii value 1 and the row
    >terminator is ascii value 2. Rather than pasting in the
    >actual ascii representations which shows up as a box, I
    >would like to be able to specify the values using a
    >control character or even CHAR function. I have tried all
    >of the following ways and none work:
    >
    > FIELDTERMINATOR = '0x01',
    >
    > FIELDTERMINATOR = 0x01,
    >
    > FIELDTERMINATOR = CHAR(1),
    >
    > DECLARE @field varchar(1)
    > SET @field = CHAR(1)
    > FIELDTERMINATOR = @field,
    >
    >So does anybody have any other ideas how to specify ascii
    >values 1 & 2 for field and row terminators?
    >
    >
    >
    >
    >.
    >


  • Next message: Peter Yeoh: "Re: SQL Profiler advise needed"

    Relevant Pages

    • Re: specifying a non printable ascii value as the field terminator
      ... Even if you could specify it, ... better off running the file through some utility to replace the terminators ... The field terminator is ascii value 1 and the row ... control character or even CHAR function. ...
      (microsoft.public.sqlserver.tools)
    • Re: Automated conversion to C++?
      ... How would you write a line that had an ASCII 10 in the middle ... I have no doubt that with Posix one could write a subset of Ada, ... I'm sorry, but full Ada does not specify how line termination is implemented, nor guarantee that all values of Character may appear in a line that will be read back as written. ... ARM A.10 says they depend on the implementation, and may be actual characters, or "inline reserved characters", as you call them. ...
      (comp.lang.ada)
    • Re: File-Compare "fc" falsely reports mismatch between identical files
      ... first and last lines of each set of differences, whereas /L is said to compare files as ascii text. ... Show me a couple of "text files" that fc/a does not compare properly, and I would argue that they are so extreme in some way that I would not consider them "text files". ... One of the definitions found by google is this: "A file that contains characters organized into one or more lines. ... the tax department reacted to a customer's complaint and insisted that the faulty tax calculation be fixed. ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: POS. Cash Register on AS400.- New and Updates
      ... Probably the easiest way would be to send them as ASCII. ... You need to change the printer file to not convert unprintable characters. ... "The INITPRT tag defines the ASCII control ... but still can not open cash drawer. ...
      (comp.sys.ibm.as400.misc)
    • Re: Unicode Support
      ... consider:)...but, you know, a file is still just a "stream of characters" ... "escape sequence" but accessing an ordinary ASCII character) are considered ... English, while all your identifiers are in "Romanji" Japanese or something ... NASM appears already to do so with strings and comments in ...
      (alt.lang.asm)