Tokenizer - Delimeter inside of Quotes

Hey People,
So I am working at getting a little program made for movie listings. It's easy enough but I have hit a snag. I use a StringTokenizer to go through my movie data, which looks like this,
"4","0900215NS","Lady In The Water ","PG"
My problem isn't terrible movies being listed (unfortunately), but some of my listings look like so...
"4","0900210NS","Lake House, The ","PG"
Wow, another terrible movie... but sorry, my problem is that I am using a comma (,) as my delimeter for my tokenizer and for movies (terrible or not) with a comma in the name, the movie name is being "tokenized" and is messing up my program. I know there has got to be an easy fix for this, but I can't seem to find it anywhere!
If anyone could give me a kick in the right direction it would be a great help! Thanks and Cheers!
--LD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

This code gives you this output.
public static void main(String[] args)
        String s = "\"4\",\"0900210NS\",\"Lake House, The \",\"PG\"";
        System.out.println( s );
        StringTokenizer st = new StringTokenizer( s, "\"", false );
        while ( st.hasMoreElements() )
            String token = st.nextToken();
            if ( !token.equals( "," ) )
                System.out.println( token );
    }"4","0900210NS","Lake House, The ","PG"
4
0900210NS
Lake House, The
PG
Message was edited by:
Norweed

Similar Messages

  • SQL Loader: double quotes inside double quotes

    Hello,
    I need to find a solution for loading some data that contains double quotas. The csv contains data like:
    "1";"Name1";"Name2"
    "2";"Name3 "another thing here"";"Name4"
    "3";"Name33 "thing here"";"Name "name" Name"
    The data inside the " " must be loaded exactly as it is, that means that in the DB, for row2, column2 the data must be: Name3 "another thing here". I cannot remove the qoutes.
    the CTL:
    LOAD DATA
    CHARACTERSET AL32UTF8
    INTO table table_name
    APPEND
    FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\"'
    TRAILING NULLCOLS
    Column1,
    Column2,
    Column3
    Could anyone help on this?

    try with this ctl
    LOAD DATA
    CHARACTERSET AL32UTF8
    INTO table table_name
    APPEND
    FIELDS TERMINATED BY ';' ENCLOSED BY '"'
    TRAILING NULLCOLS
    Column1,
    Column2,
    Column3
    )also refer to
    here and here
    for detailed explanations and instructions

  • How to put single quotes inside single quotes

    Hi all,
    My requriement is to put a statement
    LIKP~VSTEL <> INF
    in a variable LV.
    For that I have written
    CONCATENATE LV 'LIKP~VSTEL <> "INF" ' INTO LV.
    where LIKP is a table as VSTEL is a table field.
    When this LV is used inside a select query, the value for LIKP~VSTEL is "INF", but I want without the double quotes. Can any one please help me with this.
    Thanks and Regards,
    Avinash

    Hi,
    Iif you mean LV should hold something like LIKP~VSTEL = ' INF ', then try this
    data: c_quote(4) type c value ''''.
    data: l_inv type string.
    CONCATENATE c_quote 'INF' c_quote into l_inv.
    CONCATENATE ' LIKP~VSTEL' '='  l_inv  INTO LV separated by space.
    Regards,
    Vikranth.
    Edited by: Vikranth.Reddy on Sep 1, 2009 1:55 PM

  • Extracting string inside double quote

    Hi,
    In perl this is really easy, but I can't get it to work correclt in java. I'm trying to extract a string that is in double quotes following a keyword...
    String: SRCH base="o=answer" filter="me" attrs=ALL
    I want to extract the first quoted value after "SRCH base="
    In perl I used: / SRCH base=\"(.*)\" /i
    In java I'm using: " SRCH base=\"(.*)\" "
    The problem is that it doesn't stop after hitting the second quote. So I get this result:
    o=answer" filter="me
    Notice that it stopped matching after hitting the third quote. Weird.
    I know this is probably really simple, but I'm stumped.
    Thanks,
    Mark

    I guess if you wrote a regex that matches any string
    that starts with ", ends with ", and has anything in
    between you could use a Matcher to find each
    occurrence, but I don't regex enough to write it :)[url #" style="display: block; background-image: url('http://www.shanghaiist.com/attachments/shang_neil/bat-signal-edit.jpg'); width: 325px; height: 217px] 

  • 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.

  • Parse String inside PL/SQL

    What is the easiest way to parse a variable length string, containing x occurrences of data base fields (each occurrance separated
    by a delimeter) inside of a PL/SQL program.
    For example the string is: |x,y,z|x,y,z|
    Thank
    null

    The trick here is to count the number of items in the list(s). Use this code to determine the number of elements in a list:
    length('|x,y,z|x,y,z|') -
    length(replace('|x,y,z|x,y,z|','|')) - 1
    yields 2
    length('x,y,z') -
    length(replace('x,y,z',',')) + 1
    yields 3
    Note the +/- depends on the use of either a "fat" or "normal" list (i.e. delimiters at the front and back of list vs. just between elements).
    Once you know the number of elements, use substr to get the pieces. This works in plsql and sql so be creative; use a table with numbers in it if you want a solution that is sql only (my preference) as in:
    create table intgr (intgr number);
    insert into intgr values (1);
    insert into intgr values (2);
    insert into intgr values (999999...);
    select substr(...,instr(...,'|'),1,intgr.intgr ...
    from intgr
    where intgr =
    length(....)-length(....)+...
    think it through, I use this alot.
    a date table with dates from the last 300 and next 300 years works for lots of stuff too, be creative.
    create table somedates (adate date);
    Good luck.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Olga:
    What is the easiest way to parse a variable length string, containing x occurrences of data base fields (each occurrance separated
    by a delimeter) inside of a PL/SQL program.
    For example the string is: |x,y,z|x,y,z|
    Thank
    <HR></BLOCKQUOTE>
    null

  • A trim with a delimeter?

    I'm attempting write a program which reads what's inside of quotes andthen break the sentences down and I'm stuck on part of it. Is there a object or something I can use that does a trim() function that has I can set as a delimeter?

    Take a look at the Stringtokenizer class in the Java API.

  • Double Quotes in MaxL Strings

    I am trying to pass in a calc script string from a Perl script to a MaxL script. The calc script needs double quotes around some of the member names (yes, I know I can create aliases with underscores to work around this, but I can't believe this isn't possible). I can escape the double quote characters in Perl, no problem. But the double quotes just get stripped by MaxL. Here is an example:<BR><BR>MAXL> echo 'I am "quoting" this';<BR><BR>I am "quoting" this<BR><BR>MAXL> set X = 'I am "quoting" this';<BR><BR>MAXL> echo $X;<BR><BR>I am quoting this<BR><BR>MAXL><BR><BR>There is nothing in the docs about escaping double quote characters. I've tried using backslash, no luck there. I've tried using double double quotes and they all get stripped. I've tried doing this inside single quoted strings and double quoted strings - no joy whatsoever. The funny thing is the example above, where simply echoing the literal string works, but assigning it to a variable strips out the double quotes.<BR><BR>Does anyone know how to get double quotes into a MaxL string variable? There has to be a way...<BR><BR>Thanks,<BR><BR>James

    Yes, I've dealt with enclosing variables in double quotes in order for MaxL to parse them properly, but what I'm trying to do is use a variable that contains a double quote. Such as:<BR><BR> set QuoteVar = 'I am "quoting" this';<BR><BR>I'm trying to set substitution variables via MaxL, and some of my existing sub vars have double quotes in them so that they can be used to store member names that appear in calc scripts. As I said, I know I can accomplish this with an alias table that creates a version of the member name that doesn't need quotes, but that's a whole deal to maintain just for this one thing and it seems overly burdensome for such a simple task.<BR><BR>Also, as I said, MaxL does fine with double quotes in literal strings, it's only when assigned to variables that it always strips them out. I want to create a relatively generic script for setting sub vars, so I need to pass variables around. Just calling MaxL from Perl and passing in parameters that get converted to $1, $2, etc. causes these double quotes to get stripped.<BR><BR>So, is there any way around this?<BR><BR>Thanks,<BR><BR>James

  • Double quotes missing in CSV file but exist in text file from AL11

    Hi I am sending a file to AL11 with one of the fields having double quotes Like "field value" . When i download into Text file  i am seeing the quotes but not when download as CSV file from Al11. Any SAP notes for this . If i add  multiple quotes ' """" ' to have in csv I am seeing more quotes in text file which is not accepted . Please reply if anyone worked on this before . Thanks Kamesh

    The CSV file also has the quotes (check in notepad), but when opened in MS Excel, Excel has a feature to ignore double quotes and consider the comma inside the quotes as part of field, not as a field separator.

  • How to handle the quotes('') in the procedure?

    Hi all,
    I have been struggling with an issue in the procedure. Let us go to the functionality of the preocedure.
    I am passing a parameter that has text like
    ' INDIA,BANGALORE,"INOX,BLR","THILAK NAGAR,JAYA NAGAR "4TH 'T' BLOCK,BANGALORE",560030'
    Here, INDIA = country field
    BANGALORE = city field
    INOX,BLR = Theatre field
    THILAK NAGAR,JAYA NAGAR "4TH 'T' BLOCK,BANGALORE = address field
    560030 = pin field
    I want to load these fields into the table thru procedure. Here the issue is if any field value come with quotes(") inside the quotes like above address field. Since , please guide me how to handle that quotes while identifying the field value for either or address field or some other one.
    Table structure:
    country varchar2(100 char)
    city varchar2(100 char)
    theatre varchar2(100 char)
    address varchar2(2000 char)
    pin NUMBER
    Procedure Code:
    create or replace
    PROCEDURE prc_rollout_upload( p_text VARCHAR2 )
    AS
    v_quote_ind NUMBER := 0;
    v_first_pos NUMBER := 0;
    v_end_pos NUMBER := 0;
    v_text_data varchar2(32767 CHAR) := p_text;
    v_text_data1 varchar2(32767 CHAR);
    v_text_arr_ind NUMBER := 0;
    v_quote_pos NUMBER := 0;
    v_comma_pos NUMBER := 0;
    type text_rec IS RECORD(country VARCHAR2(20 CHAR),
    CITY VARCHAR2(1000 CHAR),
    exhibitor VARCHAR2(1000 CHAR),
    address VARCHAR2(10000 CHAR),
    PIN varchar2(6)
    type v_text_tab is table of text_rec;
    v_text_array v_text_tab := v_text_tab();
    BEGIN
    -- Fetch the values from the string to a PL/SQL table
    v_text_data1 := v_text_data;
    v_text_arr_ind := v_text_arr_ind + 1;
    v_text_array.extend(v_text_arr_ind);
    -- Country
    IF (INSTR(v_text_data1, CHR(34)) > 0 )
    THEN
    v_quote_ind := INSTR(v_text_data1, CHR(34));
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).country := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).country);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    END IF;
    IF ( v_quote_ind = 0 ) THEN
    v_text_array(v_text_arr_ind).country := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).country);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_ind := 0;
    END IF;
    -- City
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_quote_ind := INSTR(v_text_data1, CHR(34));
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).city := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).city);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).city := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).city);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_ind := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    -- Exhibitor
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).exhibitor := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).exhibitor);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).exhibitor := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).exhibitor);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    --Address
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).address := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).address);
    v_text_data1 := SUBSTR(v_text_data1,v_end_pos+2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).address := SUBSTR(v_text_data1,1,INSTR(v_text_data1,CHR(44))-1);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).address);
    v_text_data1 := SUBSTR(v_text_data1,INSTR(v_text_data1,CHR(44))+1);
    -- DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos :=0;
    v_end_pos := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    --PIN
    v_quote_pos := INSTR(v_text_data1,CHR(34));
    v_comma_pos := INSTR(v_text_data1,CHR(44));
    IF ( v_quote_pos < v_comma_pos )
    THEN
    v_first_pos := INSTR(v_text_data1, CHR(34));
    v_end_pos := INSTR(v_text_data1, CHR(34),1,2);
    v_text_array(v_text_arr_ind).pin := SUBSTR(v_text_data1,v_first_pos+1,v_end_pos-2);
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).pin);
    v_text_data1 := 0;
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    IF ( v_comma_pos IS NULL OR v_quote_pos > v_comma_pos ) THEN
    v_text_array(v_text_arr_ind).pin := v_text_data1;
    --DBMS_OUTPUT.PUT_LiNE(v_text_array(v_text_arr_ind).pin);
    v_text_data1 := 0;
    --DBMS_OUTPUT.PUT_LiNE(v_text_data1);
    v_first_pos := 0;
    v_end_pos := 0;
    v_quote_pos := 0;
    v_comma_pos := 0;
    END IF;
    EXCEPTION
    WHEN others then
    DBMS_OUTPUT.PUT_LiNE(SUBSTR(SQLERRM,1,200));
    END prc_rollout_upload;
    Oracle version :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    Your help would be highly appreciated !!!
    Regards,
    Vissu.....

    To start with Try this:
    SQL> ed
    Wrote file afiedt.buf
      1    declare
      2   v_var VARCHAR2(10000) := 'INDIA,BANGALORE,"INOX,BLR","THILAK NAGAR,JAYA NAGAR ';
      3    v_delim VARCHAR2(1) := ',';
      4    v_enclose VARCHAR2(1) := '"';
      5    v_val VARCHAR2(1000) := NULL;
      6    begin
      7    v_var := v_var||'"4TH T BLOCK,BANGALORE",500365'||',';
      8    FOR I IN 1..5 LOOP
      9    v_val :=  CASE WHEN SUBSTR(v_Var,1,1) <> '"' THEN
    10              SUBSTR(v_Var,1,INSTR(v_Var,',',1,1)-1)
    11              ELSE
    12              SUBSTR(v_Var,2,INSTR(v_Var,'",',1,1) - INSTR(v_Var,'"',1,1) - 1)
    13              END;
    14    v_Var :=  CASE WHEN SUBSTR(v_Var,1,1) <> '"' THEN
    15              SUBSTR(v_Var,INSTR(v_Var,',',1,1) + 1)
    16              ELSE
    17              SUBSTR(v_Var,INSTR(v_Var,'",',1,1) + 2)
    18              END;
    19    dbms_output.put_line(v_Val);
    20    END LOOP;
    21*  end;
    SQL> /
    INDIA
    BANGALORE
    INOX,BLR
    THILAK NAGAR,JAYA NAGAR "4TH T BLOCK,BANGALORE
    500365
    PL/SQL procedure successfully completed.
    SQL>

  • Unable to Load CSV file with comma inside the column(Sql Server 2008)

    Hi,
    I am not able load an CSV file with Comma inside a column. 
    Here is sample File:(First row contain the column names)
    _id,qp,c
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    When i specify the Text Qualifier as "(Double quotes) it work in SQL Server 2012, where as fail in the SQL Server 2008, complaining with error:
    TITLE: Microsoft Visual Studio
    The preview sample contains embedded text qualifiers ("). The flat file parser does not support embedding text qualifiers in data. Parsing columns that contain data with text qualifiers will fail at run time.
    BUTTONS:
    OK
    I need to do this in sql server 2008 R2 with Service pack 2, my build version is 10.50.1600.1.
    Can someone let me know it is possible in do the same way it is handle in SQL Server 2012?
    Or
    It got resolved in any successive Cumulative update after 10.50.1600.1?
    Regards Harsh

    Hello,
    If you have CSV with double quotes inside double quotes and with SSIS 2008, I suggest:
    in your data flow you use a script transformation component as Source, then define the ouput columns id signed int, Gp unicode string and C unicode string. e.g. Ouput 0 output colmuns
    Id - four-byte signed
    gp - unicode string
    cc - unicode string
    Do not use a flat file connection, but use a user variable in which you store the name of the flat file (this could be inside a for each file loop).
    The user variable is supplied as a a readonly variable argument to the script component in your dataflow.
    In the script component inMain.CreateNewOutputRows use a System.IO.Streamreader with the user variable name to read the file and use the outputbuffer addrow method to add each line to the output of the script component.
    Between the ReadLine instraction and the addrow instruction you have to add your code to extract the 3 column values.
    public override void CreateNewOutputRows()
    Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".
    For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".
    string line;
    System.IO.StreamReader file = new System.IO.StreamReader( Variables.CsvFilename);
    while ((line = file.ReadLine()) != null)
    System.Windows.Forms.MessageBox.Show(line);
    if (line.StartsWith("_id,qp,c") != true) //skip header line
    Output0Buffer.AddRow();
    string[] mydata = Yourlineconversionher(line);
    Output0Buffer.Id = Convert.ToInt32(mydata[0]);
    Output0Buffer.gp = mydata[1];
    Output0Buffer.cc = mydata[2];
    file.Close();
    Jan D'Hondt - SQL server BI development

  • 8.1.7 jdbc driver: object types with double quotes

    Hi all,
    While switching from 8.1.6 to 8.1.7 I have trouble with the jdbc driver. It doesn't work
    as before: The function CallableStatement.registerOutParameter (and probably some other) doesn't take object type
    names in double quotes anymore. A test program is appended to this message. Using a 8.1.6 jdbc driver this program works fine but with a 8.1.7 jdbc driver it throws an exception.
    My questions are: Is this bug already filed?
    Is a bugfix already available somewhere?
    Thanks in advance for any information
    Joerg
    import java.sql.*;
    * create type "test_t" as object (atrb number(10));
    * create table "test" of "test_t" (atrb not null) oidindex();
    class test
    public static void main (String args [])
    throws SQLException
    String s = "begin insert into \"test\" t values (1)" +
    " returning ref(t) into ?; end;";
    try{
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:orcl","joerg", "password");
    CallableStatement cs = conn.prepareCall( s );
    cs.registerOutParameter(1, Types.REF, "\"test_t\"");
    cs.execute();
    System.out.println("Statement returned:");
    System.out.println( cs.getObject(1) );
    cs.close();
    conn.commit();
    conn.close();
    catch(SQLException e){
    System.out.println("SQLException was thrown...");
    System.out.println(e.getMessage());
    }

    I believe that typenames are always treated as case sensitive (unless they are all uppercased).
    In your example you should write:
    cs.registerOutParameter(1, Types.REF, "test_t");
    If you had declared the type test_t in a case insensitive way (without "..."), then you'd have to write:
    cs.registerOutParameter(1, Types.REF, "TEST_T");
    If you have a schema-qualified name, use a ".":
    cs.registerOutParameter(1, Types.REF, "SCOTT.test_t");
    However, this behavior implies that you cannot use "." inside of quoted identifier names.

  • Date without single quotes in SQL Where clause turns to 00000000. Why?

    The below program works in 4.6c but does not in ECC 6.0, the issue is the date actually turns to 00000000, debug shows the internal table as having the correct value that was inserted but st05 trace shows that the variable is holding the value 00000000, this works fine when the date is put inside single quotes but the actual program where I have this issue does not warrant adding single quotes. Has someone come across this situation. Any help is appreciated!
    data v_vbeln like vbak-vbeln.
    data: begin of where_tab occurs 0,
          s_date(20) type c,
          end of where_tab.
    where_tab-s_date = 'audat = 19971106'.
    append where_tab.
    select vbeln into v_vbeln from vbak where (where_tab).
      write:/ v_vbeln.
    endselect.

    HI,
    data v_vbeln like vbak-vbeln.
    ******data: begin of where_tab occurs 0,
    ******s_date(20) type c,
    ******end of where_tab.
    ******where_tab-s_date = 'audat = 19971106'.
    ******append where_tab.
    ***** The above statements are not needed for the select query.
    ******select vbeln into v_vbeln from vbak where (where_tab).
    Your select query can be re-written as
    select vbeln into v_vbeln from vbak where audat eq '19971106'.
    write:/ v_vbeln.
    endselect.
    and if your requirement is to check for multiple dates then,
    append them to a select-options and rewrite the select query as
    select vbeln into v_vbeln from vbak where audat IN S_DATE. " S_DATE is your select-options
    Regards
    Sharath

  • Regular Expression: Extract Subgroup Content between Double Quotes

    I am using java Pattern and Matcher to match the content between the double quotes. But the result is not what I expected.
    Here are some of my code:
    String s="\"C:\abc\"'; //notice the inside double quotes are escaped double quotes.
    Pattern p= Pattern.compile("\"(.+)\"");
    Matcher m=p.matcher(s);
    if(m.matches()){....}
    Result====:
    m.groupCount()=1,
    m.group(0)="C:\abc"
    But what I want is C:\abc instead of "C:\abc". I am also confused about the group number. If group(0) matches the whole string implicitly, group(1) should represent the subgroup (.+) in the above example, right? Thanks.

    Hi,
    You probably have another error in your code.
    Execute this.
    class Test {
        public static void main(String[] args) {
            String s= "\"C:\\abc\"";
            Pattern p= Pattern.compile("\"(.+)\"");
            Matcher m=p.matcher(s);
            if(m.matches()){
                System.out.println(m.groupCount());
                System.out.println(m.group(0));
                System.out.println(m.group(1));
    }It prints
    1
    "C:\abc"
    C:\abc/Kaj

  • Approval Process of Quotes via Workflow

    Dear Experts,
    I'm looking for a Workflow solution, with which I can elektronically appove a Quote. In detail it means e.g. to reales a quote, two sgnatures are mandetory. These two people should be chosen inside the quote as a partner. After Savind they should get an e-mail notification and be able to approve the quote via e-mail (Outlook) or inside SAP.
    Is there a possibility to do that via workflow? How? Do anybody has some experience?
    Other proposals?
    Thanks in advance.
    Regards,
    Abbas

    1. backup the existing Update user workflow as an xml file
    2. Copy paste the same in the BPE.
    3. Save the copy as a new object with a different name.
    4. Edit the new workflow as follows:
    4.1 Create new activity
    4.2 In the new activity, add a variable with some name
    4.3 create a new action, and let that action be a subprocess. For that subprocess, browse and choose 'Approval' as the action.
    4.4 Add a argument as name=approvalForm and value=<name of approval form>
    4.5 Include argument user=$(user), etc. (Check the original approval workflow to see what the names of the arguments are)
    4.6 For return to=name of the variable declared, from=approved
    4.7 Add a 'isTrue' condition for the variable declared.
    5. Make the appropriate transitions, and ur ready to go.
    Let me know if this helps. I can post some skeleton code tomorrow. I need to work on it. Drop a line at [email protected]

Maybe you are looking for

  • Can't get Favicon Icon to Work

    Hi, So I can't seem to get my favicon icon to work right. I am using  Dreamweaver CS4 and I have an icon called favicon.ico in my remote  folder. Under the head tag I have : <link href="favicon.ico" rel="icon"> If I preview it in dreamweaver it works

  • Clearing out old software

    I am trying to clear out all remnants of old software, before upgrading to Snow Leopard. (I don't want to do a clean install, just put everything in order before doing a normal one.) For example, I discovered that my trial of Retrospect 8 had left th

  • My Complete MacBook Story -  Start to Finish

    The saga begins... I purchased my MacBook a few months ago. Who could resist that glossy, thin, bright, gleaming, Intel-based piece of Apple design genius? I couldn't. I was so excited to have it. I couldnt wait to unleash all of its potential. It's

  • Hello frields!

    I have to connect following fields from 18 tables. Please send me the query how to get the data collectively in the output. What wil be my approach? Order No                                               VBAK-VBELN Sales Org                          

  • Change WBS BOM Structure

    Dear Experts, I have a WBS BOM ( Copied from Material BOM) in which one common child level component is used for differernt Superior Assembleis. Now when i am deleting this component from one of the Superior Assembly, a POP UP is coming stating that