Analyze the values to a string and then place in the lines

Hi all

I need help here. I have a field called document_desc. Below is a sample of its contents:


Invoice: * 90104 * attachment document URL created in ArchiveLink content server. Number of
attachments: 3 Document ID (s): * 4FB6EB9040000ACA813, 4FB6EB924C0A2A813 *.
*, 4FB6EBB7000ACA813 * (s) URL :): http://xxxxxxxxxx
I need to do 2 things here:

1. I need to analyze the elements in bold. The number of values beginning with 4FB can vary. In this example, there are 3 of them, it could be one, there may be 10. However, they will be always between the ' ID (s):' and the ' URL (S):'

Invoice number (901825004) will always be only one and the same position, but can have different lengths.

2. I then need to format it so that it looks like:
Invoice_Number        Archive_ID
901825004               4FB6EB904C561491E1000000AC12A813
901825004               4FB6EB924C561491E1000000AC12A813
901825004               4FB6EBB74C561491E1000000AC12A813 
Any suggestions?

Published by: dgouin on May 29, 2012 11:25

Published by: dgouin on May 29, 2012 11:26

Published by: dgouin on May 29, 2012 11:27

Published by: dgouin on May 29, 2012 11:27

Published by: dgouin on May 29, 2012 11:33

Hello

Regular expressions a great help with this stuff:

WITH     got_doc_id_list     AS
(
     SELECT     x_id
     ,     REGEXP_REPLACE ( str
                      , '.*Invoice: *([^ ]+).*'
                      , '\1'
                      , 1
                      , 1
                      , 'n'
                      )     AS invoice
     ,     REGEXP_REPLACE ( str
                      , '.*Document ID\(s\):(.*)URL.*'
                      , '\1'
                      , 1
                      , 1
                      , 'n'
                      )     AS doc_id_list
     FROM    table_x
)
,     cntr          AS
(
     SELECT  LEVEL     AS n
     FROM     dual
     CONNECT BY     LEVEL <= 10     -- Max number of doc_ids possible in one str
)
SELECT       d.x_id
,       d.invoice
,       TRIM ( REGEXP_SUBSTR ( d.doc_id_list
                              , '[^,]+'
                      , 1
                      , c.n
                      )
            )    AS archive_id
FROM       got_doc_id_list  d
JOIN       cntr             c  ON  c.n  <= 1 + LENGTH (d.doc_id_list)
                                            - LENGTH (REPLACE (d.doc_id_list, ','))
ORDER BY  x_id
,            c.n
;

It works Oracl 10.1 (and higher). In Oracle 11, there are new features of regular expressions which can make it a little simpler.
I guess that your data are pretty well trained. For example, I assume that there is always something (not counting the white spaces and commas) after ' ID of Document (s): "and before"URL", and that the ID never include the substring"URL"." If these assumptions are false, then the same basic approach will work, but the details are a little messier.

I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Point where the above query was to produce erroneous results, and explain, using specific examples, how you get these results of these data in these places.
Always tell what version of Oracle you are using.

Tags: Database

Similar Questions

  • I'm not able to install illustrator creative cloud CC. This is the error when I download creative cloud app. "Cannot write the registry value. "Verify permissions, and then try again.

    I'm not able to install illustrator creative cloud CC. This is the error when I download creative cloud app. "Cannot write the registry value. "Verify permissions, and then try again.

    No one can tell you anything without the info adequate system or other technical details, including the exact error message.

    Mylenium

  • Is it possible to group objects, which are placed in the project and then hide them with line a single action-script? THX in advance, Philip

    I work in CP 9 and I'm going to try the following: the user must be able to make ALL invisible or visible to highlight boxes by clicking on the corresponding button on the first page layout. Thus, for example, if the user does not want the highlight boxes appear, click on "Hide the boxes" and boxes are hidden for the rest of the project. I managed to get to this point for help... but it is still a lot of work for me to manually enter all the different names of these boxes in the action-script. So my question is: is it possible to group objects, which are placed in the project and then hide them with line a single action-script? THX in advance, Philip

    Actually... releasing the CpExtra HTML5 widget, it will be possible.

    It has a function called @syntax that allows you to perform an action (for example HIDE) automatically on any object throughout a project of Cp9 simply based on the name of the object.

    So for example, if you named all the boxes to highlight you want hidden this way to have the suffix _HideMe and you say CpExtra you want all of them hidden if a user variable is assigned to a certain value, then that is what will happen.

    That's the good news.  The bad news is that the widget is still in BETA final tests at the moment, so you may need to wait a bit before you can realize your idea.

  • How to make a percentage of the value of a column and then insert this value in a column

    The table below should be the result I want to achieve. This means according to what value is in Column1 which corresponds to the percentage and what value is in Column2. Column1 will make a percentage of Column2. Like 80% of 1000 = 800, what will change in Column2 of 2nd record.

    Currently my code only select the current record and insert another copy that will duplicate the same record. But now I need to calculate and replace the values in column 2 according to the perentage. I did not have my code select here because I'm afraid of you all will get confused. I only put my code insert here, pls tell me how to make the formula in the code for the percentage of Column2 thanks.

    Orginal 1st record->                                                 column1 column2 
                                                                          
    80   1000  

    Inserted copy records which is 2nd record
    (what I want to achieved)   column1 column2 
                                                                          
    80   800


    My codes

     INSERT INTO table1 (column1, column2) VALUES (tran.column1, tran.column2);

    Did it using this, thanks.

    INSERT INTO table1 (column1, column2) VALUES (tran.column1, tran.column2 * tran.column1 / 100 );

  • change the values to a string and return

    Hello
    I need help to find the best way to perform a trinsformation on a field.

    I got data such as:
     
    text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore
    ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore
    text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02
    ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02
    text;moretext;andmore
    I got this questioned:
    select 
      NVL(SUBSTR(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-01'),LENGTH(';ir-')+1,LENGTH(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-01'))-7), ' ') as A,
      NVL(SUBSTR(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-02'),LENGTH(';ir-')+1,LENGTH(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-02'))-7), ' ') as B
    from mysystem
    that return results as:
    "A","B"
    "boic|notActive|notInduced","boic|notActive|notInduced"
    "boic|Active|notInduced","boic|Active|notInduced"
    "boic|notActive|notInduced","boic|notActive|notInduced"
    "baoc|notActive|Induced","baoc|Active|Induced"
    "boic|notActive|notInduced","boic|notActive|Induced"
    I need to be like:
    "A","B"
    "boic-notActive","boic-notActive"
    "boic-Active","boic-Active"
    "boic-notActive","boic-notActive"
    "baoc-notActive","baoc-Active"
    "boic-notActive","boic-notActive"
    Can someone help me on this?
    I'll try to find a solution, but I have to do this transformation in 50 million lines and probably I won't find one with good performance!

    Thank you
    Ricardo Tomas
    SQL> with t as (
      2             select 'text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore' srv_code_lst from dual union all
      3             select 'ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore' from dual union all
      4             select 'text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02' from dual union all
      5             select 'ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02' from dual union all
      6             select 'text;moretext;andmore' from dual
      7            )
      8  SELECT  CASE ';' || srv_code_lst
      9            WHEN A THEN ' '
     10            ELSE A
     11          END A,
     12          CASE ';' || srv_code_lst
     13            WHEN B THEN ' '
     14            ELSE B
     15          END B
     16    FROM  (
     17           SELECT  srv_code_lst,
     18                   REGEXP_REPLACE(';' || srv_code_lst,';(.*;ir-)([^|]*)\|([^|]*)(\|.*|-01)','\2-\3') A,
     19                   REGEXP_REPLACE(';' || srv_code_lst,';(.*;ir-)([^|]*)\|([^|]*)(\|.*|-02)','\2-\3') B
     20             FROM  t
     21          )
     22  /
    
    A                              B
    ------------------------------ ------------------------------
    baoc-notActive                 baoc-notActive
    baoc-notActive                 baoc-notActive
    baoc-notActive                 baoc-notActive
    baoc-notActive                 baoc-notActive
    
    SQL> 
    

    SY.

  • Can I create a slide show of slider/image carousel with the possibility for the links and the widths of the image to an Adobe program variable and then place in Muse

    Hello

    I really hope someone can help me with a project that led to drive me to despair.

    I'll put up an online art gallery, last year, I used Wix to create a site (explorersglobalfineart.com). Initially, I thought it was a good idea that I could build the mobile site with the site of the office. It turns out that features model are appalling and every time I add a new page I have to reinstall everything on the mobile site.

    In the last month, I've searched Adobe Muse. I started to build the site map and added to the artist page, but there are pages on the current site which have a slider carousel with the possibility for widths of the variable image and links that I cannot emmualte in Muse - http://www.explorersglobalfineart.com/#! Asia/cfvg

    Is there an Adobe program that I can use to create a cursor image carousel with the ability to tie and use images with varying widths which is compatible with Adobe Muse?

    Thank you very much

    Rebecca

    You can try this:

    http://musewidgets.com/products/carousel-Gallery-Widget

    Thank you

    Sanjit

  • I want to analyze the values from a string

    Hello.. I want to analyze certain values in a string... it's values in my channel...

    anyType{NewDataSet=anyType{Table=anyType
    {SINo=5; ProductId=33;productname=aaa;
    price=543;};Table=anyType{SINo=1;
    ProductId=111;productname=bbb;price=543;};};}
    

    I need to display my SINo, ProductId, productname and price... everything separately... is it possible? or is it possible to convert this string to an xml and then parse the values?

    You can write a function to split this string with respect to the level of a delimiter, in this case '=' can be used, like the Split function available in the string for the Desktop Java class.

    This function returns an array of strings in which the split string values is stored.

  • All channels to HAVE it have the same value - NI PCI-6221 and NI PCI-6229

    Hello

    I use the aiex1.cpp example for a multi-channel read with the devices mseries 6221 and 6229.

    This example works for a lane, but other chains have the same value (difference of +-0.001 Volt).

    For example: I put 5 Volt on the first string, and then the other channel are 5 Volt too.

    What should I consider in the configuration?

    Heiko Hello!

    your description looks like the effect you are having 'ghosts '.

    For more information about ghost images and how to get rid of, check out these links:

    http://digital.NI.com/public.nsf/allkb/73CB0FB296814E2286256FFD00028DDF?OpenDocument

    and

    http://digital.NI.com/public.nsf/allkb/C6C7DE575301A379862572DD00480A01?OpenDocument

    Best regards

    Moritz M.

  • After update will not completely re-checkin for update and then reloading the firefox update page. (all deleted and the problem persists).

    Firefox updated as I wanted. Now, each I reopen the application is going through the screen of loading/updating before the opening of Firefox. When she opens the Firefox update page loads. I emptied everything (cache, connections, history, etc.). It will not stop. I hesitated uninstalling and reinstalling because it isn't always re - import settings, bookmarks, etc.. Love this browser and all software you provide.

    Hello Paul,

    You should look at this article on this specific issue and Preferences not savedarticle. It could be a problem of pref.js. It should give you all the information you need!

    If this does not work:

    1. Enter about: config in the address bar
    2. Click I'll be careful, I promise you if prompted
    3. In the filter field, type Startup
    4. Double click on startup.homepage_override_url
    5. Delete the text string, and then click OK
    6. Close Firefox and reopen the window to check that it worked.

    Hope this helps!

  • Value derived — concatenated string fields

    Hi all

    could you please give an example how can I set a value derived from a string field, so that it is values concatenated from several other fields of type string.

    Basically, what I want to do is to collect all the keywords in a field.

    Kind regards
    Gulnara

    Hey guliflower,

    With the help of a comprehensive rule that I have validated only that it works for me:

    first the pseudocode:

    If CERTAIN CONDITIONS

    value = variable1 & 'separator' & variable2

    endif

    If you are a derivation based on string values in the localdata (e.g. of the metadata contained in a checkin form) then the "#active." FIELDNAME"works well
    Otherwise, you will need to write additional idoc for the channels that you want to concatenate. The "&" is the operator of concat idoc, as defined in the reference guide of the IDOCScript (http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/sdk/idoc_script_reference/wwhelp/wwhimpl/js/html/wwhelp.htm)

    Here's the working example that I used on my test system. I pulled the doctype string and the string of delimited by a pipe in the comments field security group.

    Here's the code I used:

    <$if #active.ddocauthor="" like="" "sysadmin"$="">
         <$dprDerivedValue=#active.dDocType &"|"&="" #active.dsecuritygroup$="">
    <$endif$>

    It derived from the string ' document | public' in my field of xComments.

    This is interpreted as server-side:
    If the current user on this request is "sysadmin" and then take the string value of the field dDocType add a pipe ' | ' character and add the string value of the dSecurityGroup field and then place all of the contents in the xComments field.

    hope that helps,
    Warmly,.
    Billy Cripe
    Fishbowl Solutions

  • Hi, my PC does not start, it displays a screen with lines and then turns black and that of it, can you help me?

    Hi, I have a Compaq Presario C700 no problems so far. It will not start when I turn it on the screen with criss cross lines and then a vertical black line, it turns black and then that's all. ? If I turn on and off for a couple of hours it starts? Can you please help.

    Hello

    Looks like a hardware problem. Contact the seller and the Compaq Support. As Compaq OEM
    is responsible for the functioning Windows and hardware.

    Compaq - support, drivers and documentation online
    http://www.Compaq.com/country/cpq_support.html

    Compaq (HP) - Forums
    http://h30434.www3.HP.com/PSG/|

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • get list from a SQL database and create links to each lines in AS3

    I'm doing an AIR application with these conditions:

    I have a SQL database. In my table, there is a column 'categories' (with different categories (computer, books... etc.)).

    enter image description here

    In my AS3, I managed to recover "theDescription" when the user select a category. With the URLMethod and a php file.

       // create SQL $sql = "SELECT * FROM annonces where categorie = '$categorie'";

    $sql_result = mysql_query($sql, $connection) or die ("Couldn't execute query.");

    $num = mysql_numrows($sql_result); $phptheDescription = "";

    $counter = 0;

    while ($row = mysql_fetch_array($sql_result)) {

    $theDescription = $row["theDescription"];

    $phptheDescription = $theDescription;

    }

    echo  "phptheDescription=" . $theDescription;

    So my AS3 code retrieves the $phptheDescription since php and displays in a output_txt .

    Problem: in my output_txt , a 'theDescription"appears. But I have TWO Articles in the category 'Computers' (and I have 100 points in the same categories).

    How do I show all the "theDescription' that are in the same categories?

    Ex: If I choose "Computer", it should display "a Surface Pro 3" and "An IMAC". But it only shows the last element "IMAC".

    And, after that, it is possible to create "links" for each item posted?

    Here are 2 videos of short films (20 sec) explaining my problems:

    https://vid.me/DS2r

    http://sendvid.com/6iesrygk

    THX

    Hi-I've never used PHP so I could be wrong here - but it seems to me you're a loop in the records, each time as reset $theDescription to all that is in the current (rather than accumulate output) record. If you are effctively echo only the last record in the query.

    I think you should be either running the command echo inside your loop, or alternatively the concatenation of a string inside the loop and then echoing the end of the loop?

    I would be likely to generate XML data in PHP (just by concatenating strings) and then use it in my AS3 code.

  • How to change the width of the line?

    When I resize a path object, the width of the line remains the same.

    How to scale with the object?

    I thought it was possible in Flash, but I can't find any setting.

    I think it is in other Adobe applications.

    Actually, you can't evolve a shot of raw, which seems to actually like a bug. You have scaling on 'Normal' and then place it inside a clip. When you resize the clip, the width of the line dimensionnera more or less as desired.

  • I'm doing a script that takes a list of e-mail from a text file and then allow me to select a save as a string. I found some ways to get the path of the file, but I'm in check by pulling the list

    I found some ways to get the path of the file, but I am defeated by pulling the list from that. the function of the path get gives me the path as "Macintosh Users:: Documents: extractedb.txt (myUsername).

    What I can't understand is how to get a dialog box to display a list that represents the content in the text file, I need to change the contents of the text file, I need the box to show me what I chose and I want to save my selection as a single string.
    e '.

    example of extractedb.txt information:

    [email protected]

    [email protected]

    [email protected]

    * has a random number of emails as well *.

    I want this is to pull those emails from the text file and turn them into a list so I can get to be a selection in my dialog box.

    Any help would be great = D

    Assuming you have a text file with your example e-mail addresses, the following AppleScript will read this file in a list (mf_List) and then use this list as input to choose among the list. Because multiple selection is allowed (control button), the output is sent to a list (sel_addr). We check if the Cancel button was pressed by testing for false and if this condition is met, we the script error.  Based on a single or multiple list item content of the list, display accordingly.

    game of mf to ((path to the folder as text) & "mail_list.txt")

    the value mf_List to {}

    the value sel_addr to {}

    the value mf_List to paragraphs of (read file mf)

    the value sel_addr to (choose from the list mf_List with title ¬

    ('Mail list' with multiple selections allowed without empty selection allowed)

    If sel_addr is equal to false then

    Error number-128

    return

    end if

    If length of sel_addr is equal to 1 then

    sel_addr display dialog box as text

    on the other

    the value Point to the text of TID to AppleScript delimiters

    the value Point text in AppleScript return delimiters

    display the dialog box elements of sel_addr in the text

    the value Text of point AppleScript delimiters to TID

    end if

    return

  • How to execute a Perl script and returns the value as a string?

    Hi, I am trying to build an application using the eclipse 2.0.0 with the Blackberry SDK 7.1 plug-in. currently I tested Simulator 9900 version 7.1.0.523. I need to use the Perl language to access the raw biological database and returns as a string without having to write a longer program using java.

    In a stand alone Java SDK, I can use the line:

    Process p = Runtime.getRuntime () .exec ("perl script.pl")

    but when I tried to use it on the IDE for a Blackberry project, the project will not compile. It is said:

    Method exec (String) is undefined for the type of Runtime

    Hopes, can someone show me the correct syntex to use, but if no class is available, could someone show me a sample for unified research process? The names of blackberry dev is very complicated, I can't find any samples for her.

    Thank you.

    Seems interesting.

    Your idea was to download the data to the BlackBerry and then directly execute queries.

    Although there are a number of other obstacles, the first fall you in East platforms supporting Perl.  Here is the list:

    http://perldoc.Perl.org/perlport.html#supported-platforms

    BlackBerry OS Java is not included - in fact the only ' included phone OS is Symbian.  Interestingly, it seems likely that PlayBook and BB10, because they are based on the QNX operating system.

    If we discard Perl as a query language, then you will need to provide another option to search.  I think that unified search is an option, but you will have some work to do to use it.  The first thing you should do is find out if in fact, you can download the database on the BlackBerry.  The only available on the Blackberry database engine's SQL, so if you want the database can be exported to a SQL database, there is a chance that it would work.  I had a quick glance around the site, and I can't tell what the "database" is in the format.  Then I suggest that look you at that next.

    I hope this helps.

Maybe you are looking for