Can't import csv fields starting with double quotes but lack ending ones

Hi all,
When I'm trying to used external table to import a csv file, specified as using comma as delimiter optionally enclosed by double quotes, some records are rejected because a field in the record has starting double quotes, but without ending ones.
Assume the customer really want these starting double quotes, how do I change my external table specification such that these starting double quotes are treated as part of the field data and can be successfully inserted into db?
Many thanks.

I have no access to Oracle during weekends, so nothing can be tested. So here it goes:
Suggestion: DELIMITED BY '","' and of course omitt ENCLOSED BY '"'
You will have to update each row of the rows just loaded setting the first_field to substr(first_field,2) and the last_field to substr(last_field,-2)
If all the fields are not enclosed in double quotes (TRUE for strings and FALSE for numbers and dates) the situation (syntax diagrams allow two delimiters only) is somehow more complicated, anyway you can specify DELIMITED BY ',' and update all varchar2 fields in each row of the rows just loaded setting the varchar2_field to substr(varchar2_field,2,length(varchar2_field) - 2).
Regards
Etbin
After posting I noticed it's difficult to distinguish between single and double quotes:
the first DELIMITED BY should read {single quote){double quote}{comma}{double quote}{single quote)
the ENCLOSED BY should read {single quote){double quote}{single quote)
Message was edited by: Etbin
user596003

Similar Messages

  • SSIS importing comma delimited with double quote text qualifier - Works in VS - SQL Job ignores text qualifier and fails (truncation)

    I've created an SSIS package to import a comma delimited file (csv) with double quotes for a text qualifier ("). Some of the fields contain the delimiter inside the qualified text. An example row is:
    15,"Doe, John",IS2,Alabama
    In SSIS I've specified the text qualifier as ". The sample output in the connection manager looks great. The package runs perfectly from VS and when manually executed on the SSIS server itself. The problem comes when I schedule the package to run via SQL
    job. At this point the package ignores the text qualifier, and in doing so pushes half of a field into the next available column. But instead of having too many columns, it concatenates the last 2 columns ignoring the delimiter. For example (pipes are fields):
    15|"Doe| John"|IS2,Alabama
    So the failure happens when the last half of a field is too large to fit into the next available field. In the case above _John" is 6 characters where the IS2 field is char(3). This would cause a truncation failure, which is the error I receive from the
    job history.
    To further test this I created a failure flow in my data flow to capture the records failing to be pulled from the source csv. Out of ~5000 records, ~1200 are failing, and every one of the failures has a comma delimiter inside the quoted text with a 'split'
    length greater than the next ordinal field. The ones without the comma were inserted as normal and records where the split fit into the next ordinal column where also imported, with the last field being concatenated w/delimiter. Example records when selected
    from table:
    25|"Allan Percone Trucking"|GI6|California --Imported as intended
    36|"Renolds| J."|UI6,Colorado --Field position offset by 1 to right - Last field overloaded
    To further ensure this is the problem, I changed the csv file and flat file connection manager to pipe delimited, and sure enough every record makes it in perfectly from the SQL job execution.
    I've tried comma delimited on the following set ups. Each set up failed.
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 100
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 100
    Since a lot of our data comes in via comma delimited flat files, I really need a fix for this. If not I'll have to rebuild all my files when I import them to use pipe delimiters instaed of commas. I'd like to avoid the extra processing overhead if possible.
    Also, is this a known bug? If so can someone point me to the posting of said bug?
    Edit: I can't ask the vendor to change the format to pipe delimited because it comes from a federal government site.

    Just wanted to share my experience of this for anyone else since I wasted a morning on it today.
    I encountered the same problem where I could run the package fine on my machine but when I deployed to a server and ran the package via dtexec, the " delimeter was being replaced with _x0022_ and columns all slurped up together and overflowing columns/truncating
    data etc.
    Since I didn't want to manually hack the DTS XML and can't install updates, the solution I used was to set an expression on the textdelimiter field of the flat file connection with the value "\"" (a double quote). That way, even if the one stored in XML
    gets bodged somewhere along the way, it is overridden with the correct value at run time. The package works fine everywhere now.

  • Csv with double quotes

    Hello,
    I've had harsh time trying to figure out how to read a csv file with double quotes, I need to read a csv file in order to fill a spreadsheet.
    I attach a csv file example to show the sort of file I'm working on.
    Thank you
    Raymundo Cassani
    Solved!
    Go to Solution.
    Attachments:
    test_file.csv ‏1 KB

    Upon closer inspection, you are right, it was a trick question.  You need to look for commas that follow an even number of quotation marks for the separators.  Since my previous snippet was not converted, I assume you have an earlier LV version so I have attached an example in 8.6.  You can get rid of the quotes if you like (exercise for the reader).
    Attachments:
    ReadCSVwithQuotes.vi ‏9 KB

  • Importation ;I just started with lightroom 5,6 (french)-I 'd like to import with creation of a second copy apart of the catalog but impossible to activate this option.How should I do to activate this option?

    Importation ;I just started with lightroom 5,6 (french)-I 'd like to import with creation of a second copy apart of the catalog but impossible to activate this option.How should I do to activate this option?

    Importation ;I just started with lightroom 5,6 (french)-I 'd like to import with creation of a second copy apart of the catalog but impossible to activate this option.How should I do to activate this option?

  • "Safari could open this web site because the OS X can't open webpages that starts with amm"

    I try to install InDesign on my Mac after deleting a lot of programs, including all my adobe programs for some day ago. But when i try to download it just pop up a warning that tells me "Safari could open this web site because the OS X can't open webpages that starts with am

    use a different browser or use the cc desktop app to install your cc apps/trials, Download Adobe Creative Cloud apps | Free Adobe CC trial

  • I just purchased an ibook for my mac for the first time and it started with two pages then switched to one with notes and i can't change it back. Anyone else having this problem?

    I just purchased an ibook for my mac for the first time and it started with two pages then switched to one with notes and i can't change it back. Anyone else having this problem?

    Up the top where the three buttons are (red yellow green) are three images. Click on the third image that looks like a notepad (not the first which is a library book), and that should get rid of 'Notes'. To read using two pages make the window bigger.

  • How to replace single quote with double quote

    hai all,
    i have a problem,
    i am trying insert a string containing single quote into ms-access database.
    it is giving error.
    how can i avoid this .if i replace a single quote in the text with double quote it will defenitely
    insert into database.
    in java.lang.String
    replace () will not work to replace quote with double quote.
    any otherway to solve this problem.
    please mail me to [email protected]
    thank you
    sambareddy
    inida

    java.lang.String.replace () will not work to replace quote with double quote.Really?
    String x = ...
    x.replace( "'", "\"" );

  • Can I run 2 different domains with same name but on 2 different machines?

    I am trying to setup 2 domains with same name (sharedcds1) on 2 different machines (Machine1 and Machine2).
              When I start the weblogic managed server 1 (sharedcds1managedserver1) on Machine2, it throws an error saying it has some conflicts with the managed server 1 running on Machine1. How did the managed server of one machine know about the other server. Can I run 2 different domains with same name but on 2 different machines?
              Here is the error in the log -
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 4596206652609838848S:130.170.61.153:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 8842351474821025197S:130.170.61.154:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              Thanks
              Satish

    Yes you can. Make sure that domains configured to use different multicast address. WLS uses multicast for communications between nodes in domain.
              although your configuration will work, you could have troubles if you going to execute inter-domain calls between domains/servers with the same names.

  • Can i create credit note request with selling price,but without material no

    hi
    can i create credit note request with selling price, but without material no.? which item cat. i should choose?
    thanks

    Hi,
    The price is controlled for any item category with the help of the Item Category setting (VOV7 tcode) that is, the field Pricing under Business Data section.
    Select the option X in the Pricing field.
    Now for your case, the setting will be greyed out. as it is a text item....
    To make it for entering any option ....then change the option to A in the Item Type field.
    Reagrsd

  • How can I watch movies in germany with native tone, english? Any one knows how to switch the language when renting a movie?

    How can I watch movies in germany with native tone, english? Any one knows how to switch the language when renting a movie?

    I wonder the Format Tables macros on my site could be adapted?
    http://www.grainge.org/pages/authoring/word/word_macros.htm
    If not, I have used Macro Express to format tables in Rh. No reason it could not be used in Word.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • My apple id is wrong email address on i pod i can download as it comes up with right email but to update wrong email how do i delete wrong email

    my apple id is wrong email address on i pod i can download as it comes up with right email but to update wrong email how do i delete wrong email

    You have to go to Settings>Store and log out of one account and log into the other account.  If you have updates available for apps that were purchased from more than one account, you have to update the apps individually until the remaining apps were purchased from one account.

  • I can't download videos to Real Player. The settings are correct and i can download in Internet Explorer 7 with no problem but not FireFox 5...any ideas??

    I can't download videos to Real Player. The settings are correct and i can download in Internet Explorer 7 with no problem but not FireFox 5...any ideas??

    I'm still experiencing this problem.  I went to settings, general, software and it says Install now.  But when I try, I get an error message. 

  • I know I can switch two iphone 4s's with SIM cards, but can I flip a CDMA iphone 4 (no SIM) with a 4s (has SIM)?

    I know I can switch two iphone 4s's with SIM cards, but can I flip a CDMA iphone 4 (no SIM) with a 4s (has SIM)?
    My wife wants to use my daughter's 4s phone instead of her CDMA iphone 4 with no SIM.  Does verizon need to do the switch since I can't just switch SIM cards and restore from backup?

    Unless the 4S was sold for Verizon, the CDMA module is disabled. Regardless, Verizon will not activate devices on their network that were not specifically sold for their network.

  • What should I download to get started with Illustrator? I have the one app monthly subscription.

    What should I download to get started with Illustrator? I have the one app monthly subscription.

    Please refer to Creative Cloud Help | Install, update, or uninstall apps for download, install & activate the single app CC that you have purchased today.
    Regards
    Rajshree

  • Why can I sync some iTunes playlists to the iPod but some other ones don't?

    Why can I sync some iTunes playlists to the iPod but some other ones don't? This is unusual - I wonder if the iPod is working correctly but some setting is wrong. Thanks

    Connect your iPod to your computer and when it appears in the Source list click on it to show the preference tabs in the main pane. Go to the Music tab and check that your settings are "Sync Music - All songs and playlists" and not "Sync Music - Selected playlists"

Maybe you are looking for