Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Posts
    12

    Unanswered: Parsing 1 row in two rows from a CVS-file

    Hello

    im trying to read a csv-data over the external table in a target table.
    the problem is, that I have in some rows two first and last names separated with zwo spaces (look ID2 or ID4)

    the csv-data has this format:

    CVS-Source file

    ID1|"Max Miller"|"Lyonerstr 99"|"1000"|"Berlin"|"Germany"
    ID2|"Hans Meyer Heidi Meyer "|"Lyonerstr 100"|"1000"|"Berlin"|"Germany"
    ID3|"Stefan Tek"|"Lyonerstr 200"|"1000"|"Berlin"|"Germany"
    ID4|"Jose Acero Maria Acero "|"Abcstr 111"|"2000"|"Hamburg"|"Germany"

    Target table

    ID1|Max Miller|Lyonerstr 99|1000|Berlin|Germany
    ID2|Hans Meyer|Lyonerstr 100|1000|Berlin|Germany
    ID2|Heidi Meyer|Lyonerstr 100|1000|Berlin|Germany
    ID3|Stefan Tek|Lyonerstr 200|1000|Berlin|Germany
    ID4|Jose Acero|Abcstr 111|2000|Hamburg|Germany
    ID4|Maria Acero|Abcstr 111|2000"|Hamburg|Germany

    i wnated use a pl-sql regex function to parse that file.
    thanks a lot.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >i wnated use a pl-sql regex function to parse that file.
    We are not preventing you from doing so.
    Please proceed without any interference from us here.
    This is classic illustration of why one should never store more than 1 value in a single field/column
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2009
    Posts
    12
    sorry, but i have that problem now.
    can you make an example...

  4. #4
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    Quote Originally Posted by mr-sansibar View Post
    Code:
    ID1|"Max Miller"|"Lyonerstr 99"|"1000"|"Berlin"|"Germany"
    ID2|"Hans Meyer Heidi Meyer "|"Lyonerstr 100"|"1000"|"Berlin"|"Germany"
    ID3|"Stefan Tek"|"Lyonerstr 200"|"1000"|"Berlin"|"Germany"
    ID4|"Jose Acero Maria Acero "|"Abcstr 111"|"2000"|"Hamburg"|"Germany"
    Just fix the flat file before running sql on it either with an editor or shell script(i.e. perl, awk, etc.) or use the "external" table as a staging table and read the table in a procedure and insert the rows into a database table formatting the columns as you want inserting two rows for the records you pointed out that should have info duplicated on a separate row except for the name.
    Then query the database 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
  •