dcsimg
Results 1 to 6 of 6

Thread: Import text file with multiple delimiters

  1. #1
    Join Date
    Jun 2007
    Posts
    4

    Import text file with multiple delimiters

    I have a text file that I'd like to import into a SQL 2005 table. The file is tab delimited, which is easy enough to import, but I'd like the final field broken into multiple fields as well. The final field is space delimited. I've had no luck at being able to get this done. Has anyone done this?

  2. #2
    Join Date
    Sep 2005
    Posts
    168
    How do you import the text file (DTS/SSIS, Procedure, Linked server...) ???
    Last edited by mikr0s; 06-05-2007 at 01:49 PM.

  3. #3
    Join Date
    Jun 2007
    Posts
    4
    SSIS is the current method, but I'm open to suggestions.

  4. #4
    Join Date
    Jun 2007
    Posts
    1

    ...same here

    I am also importing a tab-delimited file with space-delimited values that have to be parsed and inserted into separate tables.

    Any suggestions on how to best do this will make me happy.

    I am not terribly familiar with the parsing abilities in the new DTS in SQL Server 2005 and am using C# to achieve this...but it is too slooooow. File sizes are up to 200Mb and contain one record per line that has to be parsed and inserted/updated properly.

    Thanks!

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    Possible to use same delimiter in data file?

  6. #6
    Join Date
    Jun 2007
    Posts
    4
    Quote Originally Posted by rmiao
    Possible to use same delimiter in data file?
    Not in my case. I'm parsing a syslog. The workaround that I'm going to try is logging directly to a SQL database, querying the column that contains the space delimited text, and then inserting the results into columns in a new table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •