Toad World® Forums

Text file import trimming leading spaces


#1

I’m working in Toad for Oracle v 13.0.0.80.

I’m trying to import a text file into a table consisting of two columns, an IDENTITY column and a rec_text varchar2(4000). The file consists of different record types as well as some free descriptive text at the beginning. No row is over 320 characters. Unfortunately, the file is issued by a governmental entity and I have no control on how it is created.

So I’m looking to pull the raw rows into a table and resolve the parsing within a procedure.

The problem that I’m encountering is that some rows have leading spaces which are important in differentiating the different types of records. Using the data import functionality through the Schema Browser always results in the leading spaces being trimmed even though I have turned off the trimming in the import wizard.

I’m looking for thoughts and suggestions. Thanks.


#2

Hi Christopher,

I was able to reproduce this yesterday and unfortunately did not find a workaround. The easiest thing you could do is maybe drop the file on the server somewhere, make an external table out of it, and then copy the rows into your real table (or just process them from the external).

Sorry I don’t have a better answer. I’ll work on this for next release.

-John


#3

John,

Thank you for looking into this.

I can have one of my network folks drop the data in through other means. It’s just annoying when I’m in development and have to keep going back to them.

Chris


#4

Well, I don’t know how many lines it is, but another option is paste the file into the editor and block-copy ‘insert into your_table(column_name) values (’ before each line, and ‘);’ after each line


#5

Fixed for next beta.