Copying a Substring

Hi Everyone,
Does anyone know if there is an easy way to copy a substring from a string.
For example, If I wanted to cut the domain name from the following string is my only option to repeat through each character of the origional string and construct a new string with only the parts I want?
http://developer.apple.com/documentation
I've not be able to find and AppleScript version of, SubSting, Trim or Cat. Is there such a thing?
Thanks
Chris

Hi Everyone,
Don't worry I figured out a suitable solution.
Chris

Similar Messages

  • Why is it not running

    According to my knowledge i did everything right,yet it is not running.import javax.swing.JOptionPane;
    import java.io.*;
    public class file1 {
    static int[][] number=new int[1000][1000];
    static int row,column;
        public static void main(String[] args) {
       readFile();
       /*for(int i=0;i<row;i++)
            for(int j=0;j<column;j++)
                 System.out.println(number[i][j]);
         String result="";
         for(int i=0;i<row;i++)
              result+="Row "+(i+1)+" Minimum value: "+findMinimum(i)+"\n";
         JOptionPane.showMessageDialog(null, result);
         JOptionPane.showMessageDialog(null, "Even numbers in array are: "+displayEven());
         JOptionPane.showMessageDialog(null, "Sum of all number is: "+getSum());
         //prints the box with dialogue minimum vale, even numbers in array
         //and sum of all number is: 
    for(int i=0;i<row;i++)
         sortRow(i);
    JOptionPane.showMessageDialog(null, "After sorting each row:\n"+Print());
        // prints the box with dialogue after sorting each row
    private static void readFile(){
         String ver,hor,temp;
         String[] copy= new String[1000];
         int i=0,j,len=1,beg=0,end=0;
         try{
         FileReader fr = new FileReader("test.txt");
         BufferedReader br = new BufferedReader(fr);
         if(copy[0]==null) System.out.println();
              while((copy[i++] = br.readLine()) != null);
                   fr.close();          
                   i--;     
         }catch(IOException e){}
         if(copy[0]==null) System.out.println();
              while(copy[0].charAt(end)!=',');
                   end++;
              ver=copy[0].substring(beg,end);
              row=Integer.parseInt(ver);
              beg=end;
              while(end<copy[0].length())
                   end++;
              hor=copy[0].substring(beg+1,end);
              column=Integer.parseInt(hor);
              i=0; j=0;     
              while(i<row){
                   end=0;beg=0;j=0;
                   while(end<copy[i+1].length())
                        try{
                                  while(copy[i+1].charAt(end)!=','  &&  end<copy[i+1].length())
                                       end++;
                                  }catch(StringIndexOutOfBoundsException e){}
                             temp=copy[i+1].substring(beg,end);
                             number[i][j]=Integer.parseInt(temp);
                             System.out.println(number[i][j]);
                             beg=++end;
                             j++;
                        //JOptionPane.showMessageDialog(null,"The sum is"+integers,"Samir",JOptionPane.WARNING_MESSAGE);     
                   i++;
    private static int findMinimum(int row)
    int min=0,max=0;
    for(int i=0;i<column;i++)
    if(number[row][i]>max)
    max=number[row][i];
    min=max;
    for(int i=0;i<column;i++)
    if(number[row][i]<min)
    min=number[row][i];
    return min;
    private static String displayEven()
    String result="";
    for(int i=0;i<row;i++)
    for(int j=0;j<column;j++)
    if(number[i][j]%2==0)
    result+=number[i][j]+" ";
    return result;
    private static int getSum()
    int result=0;
    for(int i=0;i<row;i++)
    for(int j=0;j<column;j++)
    result+=number[i][j];
    return result;
    private static void sortRow(int inrow)
    int tempo;
    for(int j=0;j<column;j++)
    for(int i=1;i<column;i++)
    if(number[inrow][i]<number[inrow][i-1])
    tempo=number[inrow][i];
    number[inrow][i]=number[inrow][i-1];
    number[inrow][i-1]=tempo;
    private static String Print()
    String result="";
    for(int i=0;i<row;i++){
    for(int j=0;j<column;j++)
    result+=number[i][j]+" ";
         result+="\n";
    return result;

    i did not go thro the full code.. but line 56 is the while condition.
    if(copy[0]==null) System.out.println();
    while(copy[0].charAt(end)!=',');
                   end++;you are doing a sys out if copy[0] is null.. but the while condition says copy[0].xxx()! if copy[0] (whatever it may be) is null, you will get a new line printed and after that it will thro NPE.. may be there is an else clause?? just wondering what could be the reason behind such a code flow.. if (null) sys out; null.doStuff(); what else do you expect to happen if the IF condition succeeds?

  • Translation Rule

    Hello,
    Does any one know what is the meaning of the kewyword "&" in the rule 1 /^.*/ /0&/
    thanks

    Patricio,
    Hmm that's a weird one unless I did something wrong but it looks like that translates to 0. Run the "Test voice translation-rule" command to verify.
    Ignored: ^.* None or more digits from the beginning of number
    =
    0
    and
    Either "&" or "\0" for copying the substring matched by the match pattern, which equals nothing in your scenario since you don't have a substring.
    http://www.cisco.com/en/US/products/sw/iosswrel/ps1839/products_command_reference_chapter09186a00800b350e.html#wp2036716
    http://www.cisco.com/en/US/tech/tk652/tk90/technologies_tech_note09186a0080325e8e.shtml
    Please rate any helpful posts
    Thanks
    Fred

  • Effective way to copy substring without generating garbage

    Hi,
    I am trying to copy portion of STRING1 to STRINGBUFFER1.
    STRINGBUFFER.append(STRING1.substring(from_index, to_index));
    However, above method generates a String object, then copy its content to STRINGBUFFER, creating garbage.
    Is there some way to do this without generating garbage? Of course, I know I can create a loop and copy one character at a time, but I am afraid that will be slow for huge strings. Thank you in advance.

    Using bothe StringBuilder and StringBuffer there are multiple ways to do what you want.
    Look at the API.
    There are methods for appending char arrays or ranges of CharSequences to a StringBuffer.I am sorry I should have mentioned that I am using J2ME, not J2SE. I looked at the API, but could not find anything.
    And yes, I am trying to avoid garbage as much as possible, because this code gets called quite often.
    Thank you for feedback everyone. I'm still lost with this.

  • Item Conversion Template Issue for Oracle Migration - Copy functionality

    Hi,
    I am working on Migration project which is from Radius ERP to Oracle 11.5.10.2.
    Currently working on Item Conversion. This Item conversion having the fileds like (ORGANIZATION_ID,SEGMENT1,DESCRIPTION,ITEM_TYPE,COST_OF_SALES_ACCOUNT,SALES_ACCOUNT,ATTRIBUTE_CATEGORY,ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE14,ATTRIBUTE15,GLOBAL_ATTRIBUTE10,REF_INVENTORY_ITEM_ID,REF_ORGANIZATION_ID).
    I have validated those fields and loaded into interfacing to Oracle Successfully in the master Org and Validated through Frontend.
    when I close the form, I will be receiving the below warning message and telling that Template id needs to be assign to the item before assigning item to the Org. The message is showing like
    "*You have not applied a template to this item, please apply a template before assigning this item to an ORG.*"
    Please find the below package which I wrote for this conversion requirement.
    The customer is saying like need to achieve the copy functionality based on the "REF_INVENTORY_ITEM_ID and REF_ORGANIZATION_ID".
    The Issue is am not able to handle the copy functionality and getting above message. kindly refer the package and suggest me where i am doing the mistake. Its high priority issue for me.
    Thanks in advance.
    CREATE OR REPLACE PACKAGE APPS.xxxx_inv_items_conv_pkg
    AS
    PROCEDURE xxx_item_conversion_proc (
    errbuf OUT VARCHAR2,
    retcode OUT VARCHAR2,
    p_org_id IN NUMBER,
    -- p_commit_point IN NUMBER,
    p_load_code IN VARCHAR2
    IS
    <<Local Variables Declaration>> <<For space limit deleted these variables>>
    CURSOR cur_item_master (pc_org_code VARCHAR2)
    IS
    SELECT itemstg.*
    FROM xxx_inv_system_items_stg itemstg
    WHERE itemstg.organization_id = pc_org_code
    AND itemstg.status_flag IS NULL;
    CURSOR cur_item_master_dup (pc_org_code VARCHAR2)
    IS
    SELECT itemstg.segment1, itemstg.organization_id
    FROM xxx_inv_system_items_stg itemstg
    WHERE itemstg.ROWID <
    (SELECT MAX (b.ROWID)
    FROM xxx_inv_system_items_stg b
    WHERE b.segment1 = itemstg.segment1
    AND b.organization_id = itemstg.organization_id
    AND b.organization_id = pc_org_code
    AND itemstg.status_flag IS NULL
    AND b.status_flag IS NULL);
    BEGIN
    IF p_load_code = 'Insert'
    THEN
    l_transaction_type := 'CREATE'; -- Default Value in I/F Table
    ELSIF p_load_code = 'Update'
    THEN
    l_transaction_type := 'UPDATE'; -- Default Value in I/F Table
    END IF;
    DBMS_OUTPUT.put_line ( 'Validation Starts At :'
    || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS')
    --Checking for Duplicate Records items
    BEGIN
    UPDATE xxx_inv_system_items_stg a
    SET a.status_flag = 'E',
    a.error_message = 'Duplicate Record'
    WHERE a.ROWID >
    ANY (SELECT b.ROWID
    FROM xxx_inv_system_items_stg b
    WHERE a.segment1 = b.segment1
    AND a.organization_id = b.organization_id)
    AND a.organization_id = p_org_id
    AND a.status_flag IS NULL;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Exception in updating duplicates'
    || SQLERRM
    END;
    DBMS_OUTPUT.put_line ('CheckPoint: Duplicate Record');
    BEGIN
    SELECT organization_id
    INTO l_organization_id
    FROM org_organization_definitions
    WHERE organization_id = p_org_id;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    DBMS_OUTPUT.PUT_LINE(p_org_id||' Org Does Not Exist');
    -- p_retcode := '2';
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE('Exception in Getting Org Id'||'Cannot Proceed');
    -- p_retcode := '2';
    END ;
    DBMS_OUTPUT.put_line ('CheckPoint: Orgcode' || l_organization_id);
    /* IF p_retcode = '2'
    THEN
    RETURN;
    END IF;*/
    --Block             : Setting Master and Validation Orgs Flags
    BEGIN
    SELECT DECODE (master_organization_id, l_organization_id, 'Y', 'N'),
    master_organization_id
    INTO l_master_org,
    l_master_org_id
    FROM mtl_parameters
    WHERE organization_id = l_organization_id;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_master_org := 'N';
    l_master_org_id := NULL;
    DBMS_OUTPUT.PUT_LINE(p_org_id||' Org Does Not Exist');
    END ;
    DBMS_OUTPUT.put_line ('master_organization_id');
    SELECT fnd_profile.VALUE ('USER_ID')
    INTO l_user_id
    FROM DUAL;
    -- Block : Set the SET_PROCESS_ID
    l_set_process_id := l_organization_id;
    l_insert_count := 0;
    LOOP
    BEGIN
    SELECT COUNT (segment1)
    INTO l_insert_count
    FROM mtl_system_items_interface
    WHERE set_process_id = l_set_process_id
    AND transaction_type = l_transaction_type
    AND process_flag = 1;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_insert_count := 0;
    END;
    EXIT WHEN l_insert_count = 0;
    l_set_process_id := l_set_process_id + 10;
    END LOOP;
    DBMS_OUTPUT.put_line ('SET PROCESS ID -l_insert_count ' || l_insert_count);
    IF p_load_code = 'Insert'
    THEN
    BEGIN
    FOR recitem_data IN cur_item_master_dup (p_org_id)
    LOOP
    UPDATE xxx_inv_system_items_stg
    SET status_flag = l_processed_flag,
    error_message = l_error_message
    WHERE segment1 = recitem_data.segment1
    AND organization_id = recitem_data.organization_id
    AND status_flag IS NULL;
    COMMIT;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ( 'Update of Duplicates Failed : '
    || SQLCODE
    || '--'
    || SQLERRM
    END ;
    END IF;
    FOR recitem_data IN cur_item_master (p_org_id)
    LOOP
    <<Local Variables Declaration>> <<For space limit deleted these variables>>
    IF p_load_code = 'Update'
    THEN
    l_error_message := 'Update Mode' || l_error_delimiter;
    END IF;
    --l_count := -1;
    BEGIN
    DBMS_OUTPUT.put_line ('CheckPoint: ItemValidationStart');
    SELECT DISTINCT inventory_item_id,
    restrict_subinventories_code,
    restrict_locators_code
    INTO l_inventory_item_id,
    l_restrict_subinventories_code,
    l_restrict_locators_code
    FROM apps.mtl_system_items_b msi
    WHERE msi.organization_id = l_organization_id
    AND msi.segment1 = UPPER (recitem_data.segment1);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_count := 0;
    -- l_processed_flag := 'F';
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP' || l_inventory_item_id||'-'||l_processed_flag);
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP' || l_inventory_item_id||'-'||recitem_data.ref_inventory_item_id);
    WHEN OTHERS
    THEN
    l_count := -1;
    -- l_processed_flag := 'F';
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP' || l_inventory_item_id||'-'||l_processed_flag);
    END ;
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP'||recitem_data.ref_inventory_item_id);
    IF l_count = -1
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Exception - Checking Item already Present'
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('Exception - Checking Item already Present'||l_processed_flag);
    ELSIF (l_count > 0 AND p_load_code = 'Insert')
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Item Already Exists In '
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('Exception - Checking Item already Present1'||l_processed_flag);
    ELSIF (l_count = 0 AND p_load_code = 'Update')
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Item Not Present In '
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('Exception - Checking Item already Present2'||l_processed_flag);
    END IF;
    BEGIN
    SELECT count(*)
    INTO l_seg_count
    FROM apps.mtl_system_items_b msi
    WHERE msi.organization_id = l_organization_id
    AND msi.segment1 = UPPER (recitem_data.segment1);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_seg_count := 0;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Item Not Present In Oracle'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('inventory_item_id - l_seg_count ' ||l_seg_count||'-'||l_processed_flag );
    WHEN OTHERS
    THEN
    l_seg_count := -1;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Item Not Present In Oracle'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    END ;
    IF p_load_code = 'Insert'
    THEN
    IF l_organization_id != l_master_org_id
    THEN
    BEGIN
    SELECT COUNT (1)
    INTO l_org_item_count
    FROM apps.mtl_system_items_b msi
    WHERE msi.organization_id = l_master_org_id
    AND msi.segment1 = UPPER (recitem_data.segment1);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_org_item_count := 0;
    DBMS_OUTPUT.put_line ('l_org_item_count ' ||l_org_item_count||'-'||l_processed_flag );
    WHEN OTHERS
    THEN
    l_org_item_count := -1;
    END ;
    IF l_org_item_count = -1
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Exception - Checking Item in Master '
    || l_error_delimiter;
    ELSIF l_org_item_count = 0
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Item Does Not Exist in Master '
    || l_error_delimiter;
    END IF;
    END IF;
    END IF;
    DBMS_OUTPUT.put_line ( 'CheckPoint: Iteminmasterorg'
    || l_org_item_count
    IF (recitem_data.description IS NULL AND p_load_code = 'Insert')
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message || 'Description is NULL' || l_error_delimiter;
    END IF;
    IF (recitem_data.sales_account IS NOT NULL)
    THEN
    BEGIN
    SELECT code_combination_id
    INTO l_sales_account
    FROM gl_code_combinations_kfv
    WHERE code_combination_id= recitem_data.sales_account;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    -- l_processed_flag := 'F'; --QUESTION
    l_error_message :=
    l_error_message
    || 'Sales Account Not Setup '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'CheckPoint: Salesacct_Validation'
    || l_sales_account||'-'||l_processed_flag
    WHEN OTHERS
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Sales Account Exception '
    || SQLERRM
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'CheckPoint: Salesacct_Validation'
    || l_sales_account||'-'||l_processed_flag
    END ;
    END IF;
    IF (recitem_data.cost_of_sales_account IS NOT NULL)
    THEN
    BEGIN
    SELECT code_combination_id
    INTO l_cost_of_sales_account
    FROM gl_code_combinations_kfv
    WHERE code_combination_id =
    recitem_data.cost_of_sales_account;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'COGS Account Not Setup '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'l_cost_of_sales_account'
    || l_cost_of_sales_account||'-'||l_processed_flag
    WHEN OTHERS
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'COGS Account Exception '
    || SQLERRM
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'l_cost_of_sales_account'
    || l_cost_of_sales_account||'-'||l_processed_flag
    END check_cogs_account;
    END IF;
    BEGIN
    select distinct organization_code
    into l_ref_org_code
    from org_organization_definitions
    where organization_id = recitem_data.ref_organization_id ;
    EXCEPTION
    WHEN OTHERS THEN
    l_ref_org_code:= NULL;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Reference Org Not Present'
    || p_org_id
    || ' Organization '
    || l_error_delimiter ;
    DBMS_OUTPUT.put_line ('l_ref_org_code'|| l_ref_org_code||'-'||l_processed_flag);
    END;
    BEGIN
    select concatenated_segments
    into l_ref_inventory_item_code
    from mtl_system_items_kfv
    where inventory_item_id = recitem_data.ref_inventory_item_id
    and organization_id = recitem_data.ref_organization_id ;
    EXCEPTION
    WHEN OTHERS THEN
    l_ref_inventory_item_code :=NULL;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Reference Item Not Present'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('l_ref_inventory_item_code'|| l_ref_inventory_item_code||'-'||l_processed_flag);
    END;
    IF (l_master_org = 'N' AND p_load_code = 'Insert')
    THEN
    BEGIN
    SELECT count(*)
    INTO l_description_count
    FROM mtl_system_items_tl
    WHERE organization_id = l_master_org_id
    AND inventory_item_id =
    (SELECT inventory_item_id
    FROM mtl_system_items_b
    WHERE organization_id = l_master_org_id
    AND segment1 = recitem_data.segment1);
    END ;
    IF l_description_count > 0 THEN
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Item Description Not Present'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    END IF;
    END IF;
    IF l_processed_flag = 'S'
    THEN
    BEGIN
    INSERT INTO mtl_system_items_interface
    (organization_id,
    segment1,
    description,
    ITEM_TYPE,
    COST_OF_SALES_ACCOUNT,
    SALES_ACCOUNT,
    attribute_category,
    set_process_id,
    transaction_type,
    process_flag,
    copy_organization_code,
    copy_item_number,
    creation_date,
    created_by,
    last_updated_by,
    last_update_date
    --attribute_category
    , attribute1
    , attribute2
    ,attribute3
    ,attribute4
    ,attribute5
    ,attribute6
    ,attribute7
    ,attribute8
    ,attribute9
    ,attribute10
    ,attribute11
    ,attribute12
    ,attribute13
    ,attribute14
    ,attribute15
    ,global_attribute10
    VALUES (l_organization_id,
    recitem_data.segment1,
    recitem_data.description,
    recitem_data.ITEM_TYPE,
    recitem_data.COST_OF_SALES_ACCOUNT,
    recitem_data.SALES_ACCOUNT,
    recitem_data.ATTRIBUTE_CATEGORY,
    l_set_process_id,
    l_transaction_type, --,l_transaction_type
    l_process_flag,
    l_ref_org_code,
    l_ref_inventory_item_code,
    SYSDATE, l_user_id,
    l_user_id, SYSDATE
    -- l_attribute_category
    ,recitem_data.attribute1
    ,recitem_data.attribute2
    ,recitem_data.attribute3
    ,recitem_data.attribute4
    ,recitem_data.attribute5
    ,recitem_data.attribute6
    ,recitem_data.attribute7
    , recitem_data.attribute8
    ,recitem_data.attribute9
    , recitem_data.attribute10
    ,recitem_data.attribute11
    ,recitem_data.attribute12
    ,recitem_data.attribute13
    ,recitem_data.attribute14
    ,recitem_data.attribute15
    , substr(recitem_data.global_attribute10,1,length(recitem_data.global_attribute10)-1) --recitem_data.global_attribute10
    l_insert_count := l_insert_count + 1;
    /* IF (l_insert_count = NVL (p_commit_point, 10000))
    THEN
    -- l_set_process_id := l_set_process_id + 10; -- REVERT BACK CHANGE
    l_insert_count := 0;
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Error in Inserting Item '
    || SQLERRM
    || l_error_delimiter;
    END ;
    COMMIT;
    DBMS_OUTPUT.put_line ('CheckPoint: Insertion Completed in Intfacetable');
    END IF;
    BEGIN
    UPDATE xxx_inv_system_items_stg
    SET status_flag = l_processed_flag,
    error_message = l_error_message
    WHERE segment1 = recitem_data.segment1
    AND organization_id = recitem_data.organization_id
    AND status_flag IS NULL;
    COMMIT;
    DBMS_OUTPUT.put_line ('Error Message'||l_error_message);
    EXCEPTION
    WHEN OTHERS
    THEN
    fnd_file.put_line (fnd_file.LOG,
    'Error:Updating Item:'
    || SQLCODE
    || '-'
    || SQLERRM
    END;
    END LOOP; --FOR recitem_data IN cur_item_master
    DBMS_OUTPUT.put_line ( 'Validation Ends At :'
    || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS')
    DBMS_OUTPUT.put_line ('Number of records inserted into Table Successfully -->'|| l_insert_count);
    END;
    END xxxx_inv_items_conv_pkg;
    Edited by: 896170 on Apr 12, 2013 11:58 PM

    Issue got solved... changed the PO line amount as:
    <?xdoxslt:set_variable($_XDOCTX,'line_amt',xdoxslt:to_number(LINE_AMOUNT))?>
    Reference :Syntax for 'to_number'
    Regards
    Manikanta Panigrahi

  • How to find a substring in XML-lookslike string?

    Hi,
    I have a question and wondering if anyone can help me with it.
    We have Java tool that does a string replacement inside another string (that is actually an XML request). It works fine when searching for a simple substring (that exists within 1 line of the XML string).
    But when I'm trying to find and replace a substring that covers more then 1 line of XML request - it does not work. And I'm not sure what is wrong or (more importantly) how to make it work.
    There is no return or new-line chars seen in the XML request.
    To make it more clear - here is what I have and trying to do:
    <a>
    <a>
    <b>
    <c>
    <d> </d>
    <c>
    <c>
    </c>
    </c>
    </c>
    </b>
    </a>
    </a>
    If I'll seach for either <c> OR </c> OR <d> </d> it all works fine ... BUT if Itry to find
    </c>
    </b>
    which will be copied directly from the XML request and past into field - thus it will look like this (horisontal line instead of vertical) </c> </b> - it does not work

    qavlad wrote:
    But when I'm trying to find and replace a substring that covers more then 1 line of XML request - it does not work. First statement - "more than 1 line"
    There is no return or new-line chars seen in the XML request.Second statement.
    There is no way that I can understand what you meant in your first statement in terms of your second.
    If there are no end of line characters at all then there is only one line. Period.
    If there are end of line characters, of any kind, then that would really suggest the source of the problem.

  • Download doc problem when copied from APEX_APPLICATION_FILES to local table

    Good morning!
    As the subject indicatesm, I am experiencing problems downloading a document I have copied from APEX_APPLICATION_FILES to my local table FILE_SUBJECTS
    and would be very grateful if someone could help.
    Here is the problem:
    I can successfully upload a document into APEX_APPLICATION_FILES and dowload it from there too.
    I can copy the record from APEX_APPLICATION_FILES into my local table FILE_SUBJECTS and delete that entry from APEX_APPLICATION_FILES but I cannot download it from my local table, it keeps pointing me to a page which cannot be found, so I'm guessing there is something wrong with either, my INSERT INTO statement or, my link in the report.
    My INSERT INTO statement is:
    INSERT INTO file_subjects (id,filename,updated_by,updated_on,blob_content,mime_type)
    SELECT id, filename, name, updated_by, updated_on,blob_content,mime_type
    FROM APEX_APPLICATION_FILES
    WHERE APEX_APPLICATION_FILES.filename = :P2_FILE_NAME;
    REPORT LINK
    I have tried just a normal column link in my report like: #ID# (this works when looking at APEX_APPLICATION_FILES)
    but I have also tried the following:
    #OWNER#.DOWNLOAD_MY_FILE?p_file=#ID#
    where download_my_file is a procedure:
    create or replace PROCEDURE "DOWNLOAD_MY_FILE" (p_file in number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    --apex_application.g_flow_id := 166;
    --if not(APEX_CUSTOM_AUTH.IS_SESSION_VALID) then
    -- owa_util.status_line(404, 'Page Not Found', true);
    -- return;
    --end if;
    SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM FILE_SUBJECTS
    WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end DOWNLOAD_MY_FILE;
    Many thanks in advance!
    Sue

    Sue,
    If you are running XE or running with the EPG versus the http server, you need to grant access to the procedure you are using for it to be run properly..
    You may need to look at this function, if you are using XE or have the EPG setup for your database.. http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e12856/adm_wrkspc.htm#BABEFDHI [Look for the section called *Restricting Access to Oracle Application Express by Database Access Descriptor (DAD)*]
    Thank you,
    Tony Miller
    Webster, TX

  • How could I copy contraints from one database to another?

    Hi,
    I have a specific problem.
    I have taken a datadump and executed in another database. Some how the contraints were not copied.
    So I created following script to genrated alter statement and then run the script in target database:
    declare
    cursor get_cons is
    select distinct dc.table_name table_name, decode ( substr(dc.constraint_name,1,3), 'SYS', ' ', 'CONSTRAINT ' dc.constraint_name ) contraint, wmsys.wm_concat(ucc.column_name) over ( partition by dc.constraint_name order by dc.constraint_name ) cols
    from user_constraints dc,
    user_cons_columns ucc
    where dc.table_name like '%'
    and dc.constraint_type = 'P'
    and dc.table_name = ucc.table_name
    and dc.constraint_name = ucc.constraint_name;
    lv_sql varchar2(2000);
    begin
    for i in get_cons
    loop
    lv_sql := 'ALTER TABLE '
    I.TABLE_NAME
    +' ADD ('+
    i.contraint
    +' PRIMARY KEY ( '+
    I.COLS
    +' )); ';+
    dbms_output.put_line( lv_sql );
    end loop;
    end;
    Is there a better way to do it?
    Thank You,
    Ranjeeth

    Hi,
    do u have idea about move data from development environment to production environment.
    what is the simpleast way. suppose if we refer DATAPUMP or EXP/IMP. How to do it.
    through EXP command i am exporting full database or specified tables. but problem is i am not able import which i exported tables.
    can u give me the steps to how to import .DMP files through command prompt.
    Thanks
    Venkat.

  • How to use a parameter field value as a substring in a "like" statement?

    Hi all,
    I'm trying to use a parameter field in a Record selection formula where the parameter field value would be a substring of the data stored in the field.
    My parameter field (SlctResearcher) is constructed as follows:
    Type: string
    List of Values: static
    Value Field: (Reports) RptAuthors
    (in Value Options) Allow custom values?: True
    {Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
    {Reports.RptAuthors} like "*{?SlctResearcher}*"
    When I hit F5 to generate the data, I get no results (and the parameter prompt field does not even come up...)
    If I modify the formula to put a hard-coded string, like
    "*Jones*"
    after the 'like', I get results (all the reports where "Jones" is a substring in the RptAuthors string.) If I modify the formula to just use the parameter field without the quotes/stars like:
    {Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
    {Reports.RptAuthors} like {?SlctResearcher}
    I do get the parameter prompt field, but still no results even if I put in a valid substring value (since it is not searching for a substring anymore...)
    How can I do this?
    Thanks,
    Will

    1st thing... Make a copy of your report before doing anything!!!
    To use a SQL Command, you'll want to open the Database Expert and look at the Current Connections. Expand the data source and the 1st option you see is the Add Command option.
    To find the SQL That CR is currently using, choose Database from the menu bar and select Show SQL Query...
    You can copy this and paste it directly into the command window. (If you you can write your own SQL you don't need copy CR's, it's just an option.)
    You'll also want to take not of any parameters that you have, you'll need to add them the the Parameter List of the command as well... be sure to spell them EXACTLY as they are in the design pane.
    Anyway, once the SQL statement is in the Command window you'll be able to alter the WHERE clause to use the wild cards.
    For future reference... What type of database are you reporting against???
    Jason

  • Using DBMS_LOB.COPY - (ORA-22275)

    Hi All,
    I need to copy BLOB value from one table to another.
    For that i am using DBMS_LOB.COPY.
    I am not sure if this is the right approach. If not, can someone help me out.
    Mentioned below is my sample procedure:
    CREATE OR REPLACE PROCEDURE INS_UPD_BLOB
    i_ID number,
    o_OutputStatus OUT NUMBER,
    o_OutputMessage OUT VARCHAR2
    as
    v_blob_data_d blob;
    v_blob_data_s blob;
    amt INTEGER := 4000;
    begin
    select BLOB_DATA
    into v_blob_data_d
    from blob_test_dest -- My Destination Table
    where id = i_ID
    for update;
    select BLOB_DATA
    into v_blob_data_s
    from blob_test -- My Source Table
    where id = i_ID;
    DBMS_LOB.COPY(v_blob_data_d, v_blob_data_s, amt);
    o_OutputStatus := 0;
    o_OutputMessage := 'SUCCESS';
    EXCEPTION
    WHEN OTHERS THEN
    o_OutputStatus := -1;
    o_OutputMessage := 'Procedure ins_upd_blob Failed at step no:- '||v_ErrorFlag|| ' SQL ERROR:- '||SUBSTR(SQLERRM,1,100);
    END;
    After execution i am getting following error:
    ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
    Thanks,
    Srikanth

    how about using merge instead of dbms_lob package?
    CREATE OR REPLACE PROCEDURE INS_UPD_BLOB
    i_ID number,
    o_OutputStatus OUT NUMBER,
    o_OutputMessage OUT VARCHAR2)
    as
    v_blob_data_d blob;
    v_blob_data_s blob;
    amt INTEGER := 4000;
    begin
    merge into blob_test_dest b1
    using (select id, blob_data from blob_test) b2
    on (b1.id = i_id and b1.id = b2.id)
    when not matched then insert(b1.id, b1.blob_data) values(b2.id,b2.blob_data)
    when matched then update set b1.blob_data = b2.blob_data;
    END;
    /

  • Can I search zip files for a particular substring in the name and extract the file to a folder?

    I need to search through lots of zip files, looking for files starting with a particular string.  Then extract them to any folder.  Can I do this in CVI?
    thanks

    thanks Wolfgang, but my level of experience is such that I could use a bit more detail.  Do you mean that I might find a .dll and call one of its functions from CVI?   So you know of nothing in CVI that I can use directly?  I don't think that I would want to open the zip, extract all the files, search the folder where they were extracted to, copy the file if it has the target name substring, then rezip.  Or, maybe there is a more direct solution.
    Any thoughts?
    thanks

  • Is it possible to modify a text file whithout copying it in a new one?

    Hi all,
    In fact I'm trying to use a kind of ini file to configure an application. So I have first to get information in a file using the name of the file, the name of the section and the keyname of the value I want to get. For this no problem. But I just can't change the value. I've read a lot of threads, but whithout finding a solution.
    Here is an example of the ini file:
    [SECTION1]
    KEYWORD1=VALUE1
    KEYWORD2=VALUE2
    [SECTIONk]
    KEYWORD1=VALUE1
    KEYWORD2=VALUE2
    [SECTIONn]
    KEYWORD1=VALUE1
    KEYWORD2=VALUE2
    And here what I want to have next
    [SECTION1]
    KEYWORD1=VALUE1
    KEYWORD2=VALUE2
    [SECTIONk]
    KEYWORD1=VALUE1
    KEYWORD2=ANOTHERVALUE
    [SECTIONn]
    KEYWORD1=VALUE1
    KEYWORD2=VALUE2
    I read the file like this:
    buffer = new BufferedReader (new FileReader(sourceFile));
    Then I can modify buffer like this:
    -I read a line (with buffer.readLine()) to obtain a string called oldString
    -I convert it into a StringBuffer
    -Next I use the replace method of StringBuffer class
    -I can next have a String, I'll call it modifiedString
    Now how can I place modifiedString in sourceFile at oldString's place. The only way I found to do this is to create a new file and to copy line after line all the lines from sourceFile, then to delete sourceFile and next to rename the new file in sourceFile. But I think that it's not really good and I'm sure that one (or more) of you has (have) already solve this problem with a better solution.
    Thanks a lot.
         S�bastien

    The class below remove some words from a file. I suppose you can change it so that it modify a word instead.
    import java.io.*;
    import java.util.*;
    class RemoveWord
         public static void main(String [] arg)
              Vector word=new Vector();
              for(int i=1;i<arg.length;i++)
                   word.add(arg);
              removeWord(arg[0],word);
         /*This function removes all the words beeing in the vector "word" from the file fileName     fichier fileName
         public static void removeWord(String fileName,Vector word)
              RandomAccessFile rf =null;
              try
                   rf = new RandomAccessFile(fileName, "rw");
                   int pos=-1;
                   long posCurseur=rf.getFilePointer();
                   String ligne=rf.readLine();
                   while(ligne!=null)
                        for(int i=0;i<word.size();i++)
                             String wordToRemove=(String)word.get(i);
                             pos=ligne.indexOf(wordToRemove);
                             if(pos!=-1)
                                  ligne=ligne.substring(0,pos)+ligne.substring(pos+wordToRemove.length(),ligne.length());
                                  for(int j=0;j<wordToRemove.length();j++)
                                       ligne=ligne+" ";     
                                  rf.seek(posCurseur);
                                  rf.writeBytes(ligne);
                        posCurseur=rf.getFilePointer();
                        ligne = rf.readLine();
              catch(EOFException e){e.printStackTrace();}
              catch(FileNotFoundException e){e.printStackTrace();}
              catch(IOException e){e.printStackTrace();}
              catch(Exception e){e.printStackTrace();}
              finally
                   try
                        rf.close();
                   catch(IOException e){e.printStackTrace();}

  • Copy file in java

    i copy a picture from one location to another using FileInpustStream method..
    is there any better way to copy file faster, cause using this way takes way to much time to copy a picture file
              try
                   FileInputStream r=new FileInputStream(new File(source));
                   FileOutputStream w=new FileOutputStream(new File(destination));
                   int only;
                   while((only=r.read())!=-1)
                        w.write(only);
                   r.close();
                   w.close();
              catch(Exception er)
                   System.out.println(er);
              }

    Here's the difinitive tutorial on java io performance tweaks:
    http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/
    Based on the examples there in (plus some of my own illconceived numbknuckle (think about it) ideas:-)
    package krc.utilz.io;
    import java.util.Collection;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.io.File;
    import java.io.Reader;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.io.InputStream;
    import java.io.FileInputStream;
    import java.io.Closeable;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    * @class: krc.utilz.io.Filez
    * A collection of static "file handling" helper methods.
    public abstract class Filez
      public static final int BFRSIZE = 4096;
       * reads the given file into one big string
       * @param String filename - the name of the file to read
       * @return the contents filename
      public static String read(String filename)
        throws FileNotFoundException
        return Filez.read(new FileReader(filename));
       * Reads the contents of the given reader into one big string, and closes
       * the reader.
       * @param java.io.Reader reader - a subclass of Reader to read from.
       * @return the whole contents of the given reader.
      public static String read(Reader in)
        try {
          StringBuffer out = new StringBuffer();
          try {
            char[] bfr = new char[BFRSIZE];
            int n = 0;
            while( (n=in.read(bfr,0,BFRSIZE)) > 0 ) {
              out.append(bfr,0,n);
          } finally {
            if(in!=null)in.close();
          return out.toString();
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * (re)writes the given content to the given filename
       * @param String content - the new contents of the fil
       * @param String filename - the name of the file to write.
      public static void write(String content, String filename) {
        try {
          PrintWriter out = null;
          try {
            out = new PrintWriter(new FileWriter(filename));
            out.write(content);
          } finally {
            if(out!=null)out.close();
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * Appends the given content to the given filename.
       * @param String content - the string to write to the file.
       * @param String filename - the name of the file to write to.
      public static void append(String content, String filename) {
        try {
          PrintWriter out = null;
          try {
            out = new PrintWriter(new FileWriter(filename, true)); //true=append
            out.write(content);
          } finally {
            if(out!=null)out.close();
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * reads each line of the given file into an array of strings.
       * @param String filename - the name of the file to read
       * @return a fixed length array of strings containing file contents.
      public  static String[] readArray(String filename)
        throws FileNotFoundException
        return readList(filename).toArray(new String[0]);
       * reads each line of the given file into an ArrayList of strings.
       * @param String filename - the name of the file to read
       * @return an ArrayList of strings containing file contents.
      public static ArrayList<String> readArrayList(String filename)
        throws FileNotFoundException
        return (ArrayList<String>)readList(filename);
       * reads each line of the given file into a List of strings.
       * @param String filename - the name of the file to read
       * @return an List handle ArrayList of strings containing file contents.
      public static List<String> readList(String filename)
        throws FileNotFoundException
        try {
          BufferedReader in = null;
          List<String> out = new ArrayList<String>();
          try {
            in = new BufferedReader(new FileReader(filename));
            String line = null;
            while ( (line = in.readLine()) != null ) {
              out.add(line);
          } finally {
            if(in!=null)in.close();
          return out;
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * reads the whole of the given file into an array of bytes.
       * @param String filename - the name of the file to read
       * @return an array of bytes containing the file contents.
      public static byte[] readBytes(String filename)
        throws FileNotFoundException
        return( readBytes(new File(filename)) );
       * reads the whole of the given file into an array of bytes.
       * @param File file - the file to read
       * @return an array of bytes containing the file contents.
      public static byte[] readBytes(File file)
        throws FileNotFoundException
        try {
          byte[] out = null;
          InputStream in = null;
          try {
            in = new FileInputStream(file);
            out = new byte[(int)file.length()];
            int size = in.read(out);
          } finally {
            if(in!=null)in.close();
          return out;
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * do files A & B have the same contents
       * @param String filenameA - the first file to compare
       * @param String filenameA - the second file to compare
       * @return boolean do-these-two-files-have-the-same-contents?
      public static boolean isSame(String filenameA, String filenameB)
        throws FileNotFoundException
        try {
          File fileA = new File(filenameA);
          File fileB = new File(filenameB);
          //check for same physical file
          if( fileA.equals(fileB) ) return(true);
          //compare sizes
          if( fileA.length() != fileB.length() ) return(false);
          //compare contents (buffer by buffer)
          boolean same=true;
          InputStream inA = null;
          InputStream inB = null;
          try {
            inA = new FileInputStream(fileA);
            inB = new FileInputStream(fileB);
            byte[] bfrA = new byte[BFRSIZE];
            byte[] bfrB = new byte[BFRSIZE];
            int sizeA=0, sizeB=0;
            do {
              sizeA = inA.read(bfrA);
              sizeB = inA.read(bfrB);
              if ( sizeA != sizeB ) {
                same = false;
              } else if ( sizeA == 0 ) {
                //do nothing
              } else if ( !Arrays.equals(bfrA,bfrB) ) {
                same = false;
            } while (same && sizeA != -1);
          } finally {
            Clozer.close(inA, inB);
          return(same);
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * checks the given filename exists and is readable
       * @param String filename = the name of the file to "open".
       * @param OPTIONAl String type = a short name for the file used to identify
       *  the file in any exception messages.
       *  For example: "input", "input data", "DTD", "XML", or whatever.
       * @return a File object for the given filename.
       * @throw FileNotFoundException if the given file does not exist.
       * @throw IOException if the given file is unreadable (usually permits).
      public static File open(String filename)
        throws FileNotFoundException
        return(open(filename,"input"));
      public static File open(String filename, String type)
        throws FileNotFoundException
        try {
          File file = new File(filename);
          String fullname = file.getCanonicalPath();
          if(!file.exists()) throw new FileNotFoundException(type+" file does not exist: "+fullname);
          if(!file.canRead()) throw new RuntimeIOException(type+" file is not readable: "+fullname);
          return(file);
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * gets the filename-only portion of a canonical-filename, with or without
       * the extension.
       * @param String path - the full name of the file.
       * OPTIONAL @param boolean cutExtension - if true then remove any .ext
       * @return String the filename-only (with or without extension)
      public static String basename(String path) {
        return(basename(path,false));
      public static String basename(String path, boolean cutExtension)
        String fname = (new File(path)).getName();
        if (cutExtension) {
          int i = fname.lastIndexOf(".");
          if(i>0) fname = fname.substring(0,i);
        return(fname);
    }Use it freely. Modify it. Improve it, and pass it back to the community free of charge, except if you are a serving member of the military (any of them), a spook, a drug dealer, an arms manufacturer, an arms dealer, a defense contractor, or a "security consulant", in which case you can go f&#117;ck yourself, sorry.
    Cheers. Keith.

  • Substring Location in String

    I am having a problem using substring to select/filter.  The substring selection is not holding to the specified locations in the string.  Instead, it finds any matching text in the entire string.
    For reference, my web site intent is,
    1. A single XML master data base contains all photographs for display.  My XML data set does not have quotes.
    2. Spry tabbed panels are used to select galleries (Spry regions) (e.g. roses, Big Sur Coast, etc) from the master data base.  There are a dozen galleries.
    3. Thumbnails of a gallery are displayed in the content panel.
    4. Selecting a thumbnail displays a large view of the selected photo in a separate div (Spry detail region).
    The galleries are filtered using spry:test, with the "subject" variable compared against a specified value (i.e. rose, Monterey, Salinas, etc.).
    The "2010 Photographs" gallery is determined by the year of the photo.  In the "name" variable, the first 6 digits are the date (month, day, year).  I've set up the spry:test with substring as follows,
    spry:test="'substring({name},5,2)'.search ('10 ') != -1;"
    This is to obtain the 5th and 6th locations of "name" variable and compare it with the "10 ".
    A sample of the "photo" node follows,
    <photo>
    <name>032010 Lover's Pt, Pacific Grove 02a web.jpg</name>
    <width>599</width>
    <height>400</height>
    <thumbname>032010 Lover's Pt, Pacific Grove 02a thumbnail.jpg.</thumbname>
    <thumbwidth>150</thumbwidth>
    <thumbheight>100</thumbheight>
    <subject>night</subject>
    <description>West side of Lover's Point, Pacific Grove, Ca.; the surf was unusually calm.  The glow reflecting on the clouds and the bay is from the town of Santa Cruz.</description>
    </photo>
    <photo>
    <name>090609 Pelican over Pacific Grove 02a 8x10 web.jpg</name>
    <width>500</width>
    <height>400</height>
    <thumbname>090609 Pelican over Pacific Grove 02a 8x10 thumbnail.jpg</thumbname>
    <thumbwidth>125</thumbwidth>
    <thumbheight>100</thumbheight>
    <subject>animal</subject>
    <description>Pelican caught in flight; using a flash, this photograph was taken at dusk; Pacific Grove, Ca.</description>
    </photo>
    Both of these nodes would be selected with the "10 " criteria.  However the second one is not from the year 2010.
    The full source code is shown below.
    My search of these forums and the Internet have indicated that this should work.  Please explain what I am missing or doing incorrectly in the code.
    I thank you.
    Scott
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>EnvisionMoore</title>
    <style type="text/css">
    <!--
    body {
    background-color: #FFF;
    text-align: center;
    margin: 0px;
    padding: 0px;
    #wrapper {
    width: 98%;
    margin-top: 10px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    border: 0px dashed #F0F;
    position: absolute;
    left: 1px;
    top: 1px;
    height: 825px;
    background-color: #FFE4CA;
    #leftColumn {
    float: left;
    height: 700px;
    width: 400px;
    position: relative;
    left: 0px;
    top: 0px;
    #header {
    height: 125px;
    font-size: 24px;
    font-style: italic;
    vertical-align: bottom;
    padding: 0px;
    text-align: center;
    float: right;
    width: 50%;
    border: 0px solid #F00;
    position: relative;
    top: 0px;
    right: 0px;
    #selectedPhoto {
    height: 600px;
    font-size: 24px;
    font-style: italic;
    vertical-align: middle;
    padding: 0px;
    text-align: center;
    margin-top: 135px;
    width: 650px;
    border: 0px solid #0F0;
    position: absolute;
    right: -1px;
    bottom: 1px;
    -->
    </style>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var name;
    var width;
    var height;
    var thumbname;
    var thumbwidth;
    var thumbheight;
    var subject;
    var description;
    var thumbnail;
    var dsphoto;
    var dsdata;
    //-->
    </script>
    <script type="text/javascript">
    var dsdata = new Spry.Data.XMLDataSet("EM_photo.xml", "/gallery");
    var dsphoto = new Spry.Data.XMLDataSet("EM_photo.xml", "gallery/photos/photo");
    </script>
    <script type="text/javascript">
    function MM_callJS(jsStr) { //v2.0
      return eval(jsStr)
    </script>
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="leftColumn">
        <div id="TabbedPanels1" class="TabbedPanels">
          <ul class="TabbedPanelsTabGroup">
            <li class="TabbedPanelsTab" tabindex="0">Welcome</li>
            <li class="TabbedPanelsTab" tabindex="0">Mechanical Engineering</li>
            <li class="TabbedPanelsTab" tabindex="0">Photography</li>
          </ul>
          <div class="TabbedPanelsContentGroup">
            <div class="TabbedPanelsContent">
              <h1><br />
      <br />
      <br />
      <br />Welcome!
      <br />
              </h1>
            </div>
            <div class="TabbedPanelsContent">Mechanical Engineering - Content 2</div>
            <div class="TabbedPanelsContent"> <!-- Photography - Content 3 -->
              <div id="TabbedPanels2" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">2010 Photographs</li>
                  <li class="TabbedPanelsTab" tabindex="0">Roses</li>
                  <li class="TabbedPanelsTab" tabindex="0">Calla Lilies</li>
                  <li class="TabbedPanelsTab" tabindex="0">Other Blossoms and Leaves</li>
                  <li class="TabbedPanelsTab" tabindex="0">Pacific Grove Beach</li>
                  <li class="TabbedPanelsTab" tabindex="0">Monterey Harbor and Beach</li>
                  <li class="TabbedPanelsTab" tabindex="0">Big Sur Coast</li>
                  <li class="TabbedPanelsTab" tabindex="0">Salinas Valley</li>
                  <li class="TabbedPanelsTab" tabindex="0">Animals</li>
                  <li class="TabbedPanelsTab" tabindex="0">Night</li>
                  <li class="TabbedPanelsTab" tabindex="0">Church</li>
                  <li class="TabbedPanelsTab" tabindex="0">Other</li>
                </ul>
                <div class="TabbedPanelsContentGroup-2">
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'substring({name},5,2)'.search ('10 ') != -1;" ; onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat = "dsphoto" spry:test="'{subject}'.search (/rose/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/callalily/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = "{thumbwidth}px" height = "{thumbheight}px" onclick="dsphoto.setCurrentRow('{ds_RowID}');" spry:repeat="dsphoto" spry:test="'{subject}'.search (/blossom/) !=-1;" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = "{thumbwidth}px" height = "{thumbheight}px" onclick="dsphoto.setCurrentRow('{ds_RowID}');" spry:repeat = "dsphoto" spry:test="'{subject}'.search (/^p/) !=-1;" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/Monterey/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/bigsurcoast/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/Salinas/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/animal/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/night/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/church/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/other/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                </div>
              </div>
            </div>
            <!-- End "Photography Content 3" Tabbed Panels Content. -->
          </div>
        </div>
      </div><!-- End div "leftColumn" -->
      <div id="header">
        <p>Envision Moore</p>
        <p>      Mechanical Engineering and Photography</p>
        <p>      Scott W. Moore</p>
      </div><!-- End div "header". -->
      <div id="selectedPhoto">
      <div id="Selection" spry:detailregion = "dsphoto dsdata"  >
    <!-- Selected photographs are 400px tall. -->
    <img src="Photo-Email/{name}" width = {width}px height = {height}px align="center" />
      <br />
    Description<br /><br />
    <p> {dsphoto::email/base}{description} </p>
    </div>
    </div> <!-- End div "selectedPhoto". -->
    </div> <!-- End div "wrapper" -->
    <script type="text/javascript">
    <!--
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
    //-->
    </script>
    </body>
    </html>

    Moore6931 wrote:
    Ben
    I thank you but the change of the starting location did not correct the problem.  I copied your script and pasted it into the source code but the results were the same set of thumbnails; several of the thumbnails are prior to (20)10.
    In considering the results, I decided to try,
    spry:test="'{name}'.search  ('10 ') != -1;"
    This filter gave the same result as,
    spry:test="'substring({name},4,2)'.search  ('10 ') != -1;"
    I found out that the "4,2" arguments of substring should be "4,6".  Each of these arguments are locations; other substring functions have location and length.
    I updated the filter to,
    spry:test="'substring({name},4,6)'.search  ('10') != -1;"
    The filter result was not changed.  Are the location arguments being ignored or overwritten by a default setting?  The symptom is that the first location is "0" and the second location is omitted.
    I thank you for your help.  This is rather fascinating!
    Scott
    Howdy,
    When you take a closer look at your at your code you will notice that you actually wrapped the substring function inside a string. So you are actually performing a search on:
    'substring(contents,4,6)'
    So what i would suggest is to do:
    spry:test="'{name}'.substring( 4,6 ).search( '10' ) != -1 "
    And if that doesn't work, try to use a function::syntax instead, see API: function::<function name>

  • How to select multiple substring in JTextarea at the same time?

    I want to select multiple substring in a jtextarea at the same time by select(start,end) method, turns out only the last substring is highlighted, how to implement my goal?

    jamesybaby wrote:
    What you got so far? A SCCEE would be nice?my aim is to search key words in jtextarea and highlight all matched result.
    package frame;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class FrmSelect extends JFrame {
        public FrmSelect() throws HeadlessException {
            setSize(800, 600);
            final JTextField tfKey = new JTextField();
            tfKey.setPreferredSize(new Dimension(200, 20));
            final JTextArea taContent = new JTextArea();
            JScrollPane jsp = new JScrollPane(taContent);
            tfKey.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    String key = tfKey.getText();
                    String content = taContent.getText();
                    String[] splited = content.split(key);
                    Pattern ptn = Pattern.compile(key, Pattern.CASE_INSENSITIVE + Pattern.MULTILINE);
                    Matcher matcher = ptn.matcher(content);
                    taContent.requestFocusInWindow();
                    while (matcher.find()) {
                        int start = matcher.start();
                        int end = matcher.end();
                        taContent.select(start, end);
            add(tfKey,BorderLayout.SOUTH);
            add(jsp,BorderLayout.CENTER);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setVisible(true);
        public static void main(String[] args) {
             new FrmSelect();
    }please copy below into the jtextarea and type key 'prop' in the jtextfield, press return.
    prop1adsfasfd
    prop2adsfasdfadsf
    prop3asdfasdfasdf

Maybe you are looking for

  • Photoshop CC 2014, No 3D option?

    I just resat my PC. Reinstalled Photoshop CC 2014. But there's no "3D" option. Before I resat my PC I had the "3D" option. Help please...

  • Look and Feel Issues from NWDS 7.0.9 on Windows 7

    Dear Experts, I have successfully installed a new NWDS 7.0.9 on my 18' inch laptop:   Windows 7 (64Bit)   JDK 1.4.18 (32Bit) The NWDS starts without any problems however, i am begining to experience some erratic behavior from the projects i have crea

  • I cant upload music to djpro app

    at least idk how to. its rly ****** me off.... half of the apps sold by apple are complete bs

  • Search Function in iTunes Store Non-Responsive

    I have an iPhone running iOS 7.0.4 (11B554a). Regardless of using wifi, data , or cable, the "Search" function inside the iTunes store appears as a white screen - No previous searches or keyboard dispalys. I have logged out in Settings>iTunes&AppStor

  • Trouble with wired and wireless home network

    I recently installed a WTR54GS with my desktop wired to it and my laptop wireless.  My laptop can get to the internet (router is attached to a cable modem) but it can not see shared files on the desktop or the printer that is attached to the desktop.