Replace text accross application

I need to replace some text across my entire application in a bunch of pl/sql code. Is there a way to do this in APEX?
Details:
Initially I created a variable P101_REALUSER. I used this for holding my user names as they had mixed case (ie: UsEr11). I have now changed the mixed case deal where all usernames are one case there by I can use APP_USER, V('USER') etc.
However I have a lot of pl/sql and branch statements that use the old variable. I am hoping to be able to write a pl/sql function to replace all of my :P101_REALUSER s with :APP_USER and all my &P101_REALUSER. with &USER.
Since this question will probably be addressed by a rather sophisticated user, I am also curious about this:
Are there any resources that catalog best practices/design templates for applications that utilize APEX? My background is in software engineering but I am finding it difficult to apply the principals such as code reuse to my APEX projects.
Thanks for any help.

1) In Apex source-export app and with regular editor replace values as you want. be careful to make a backup of export before!
2) In PLSQL packages, use Toad, save all packages/proc/functions to file and with editor (i.e. UltraEdit) replace in FILES values that you want.
Hope this helps
P.S.
This is the technique I use everyday...and all ends well if you are careful in replacing!
Message was edited by:
Funky

Similar Messages

  • Applescript: open Pages doc from Templete, change filename and replace text

    Hi!
    I just got started with applescript and i want a script that does the following:
    1. open "choose from list" dialog to choose the topic of my document
    from 4 possibilities (here for example A, B, C, D)
    2. open document from TemplateXY
    3. set document name with date and topic (dd.mm.yyy) "16.02.2011 - A"
    4.inside of document: replace text "date" with the currend date (dd.mm.yyy)
    and the text "topic" with the topic chosen in (1.) "A"
    this is what i already did:
    here as colored screenshot:
    http://i55.tinypic.com/2mnhxkm.jpg
    set datum to do shell script "date \"+%d.%m.%Y\""
    --choose topic:
    set chosentopic to choose from list {"A", "B", "C", "D"}
    --text "topic" becomes replaced throug variable topic
    set searchstringT to "topic"
    set replacestringT to chosentopic
    --text "date" gets replaced by currend date (variable datum)
    set searchstringD to "date"
    set replacestringD to datum
    --open pages, define filename & do search&replace of the strings defined above
    tell application "Pages"
    activate
    set DocName to datum & " - " & chosentopic
    set (every text where it is searchstringT) to replacestringT
    set (every text where it is searchstringD) to replacestringD
    end tell
    the "choose from list" dialog works and the variables like topic, datum and the search&replace strings get defined as well
    my problems are:
    i only get an error that the text could not be replaced
    i dont know how to get a new document from a template and how to get its filename changed
    i really just started doin things with applescript for a day so i hope you can help me
    regards
    DaNylz
    Message was edited by: DaNylz

    Try something like this:
    set myFoundItems to change text text of all page items of pages 3 thru 5 of document 1
    Shane Stanley <[email protected]>
    AppleScript Pro Sessions <http://scriptingmatters.com/aspro>

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • SQL Replace function: errors if replacement text is 8191 characters

    Oracle 10.2.0.3.0 Enterprise Edition
    I'm working on an application which has a function to generate emails.
    We have a template, which gets filled with data from the database depending on the email being sent.
    To do this I'm using the Replace function to replace certain parts of the template with the right data.
    It seems that if the replacement text (the third argument to the function) is longer than 8191 bytes the function throws a PL/SQL: numeric or value error.
    This limitation doesn't appear to be documented anywhere, certainly nowhere that I can find.
    Anyone know of a way around this short of building my own replace function?

    I've figured out what was going on.
    The database column for the replacement text is defined as a clob, but there is a front end limit of 10,000 characters for the field being used.
    When using the replace function I was assigning the value to a varchar2(32767) field in the PL/SQL.
    So in terms of datatypes the function call is:
    varchar2 := replace(varchar2, varchar2, clob)
    If the length of the clob is over 8191 characters it errors.
    (Presumably because of the bug mentioned in this thread DBMS_LOB.SUBSTR() returning 8191 characters instead of 32767
    I've fixed it by simply changing the datatype of the variable to which the value is being assigned to a clob.

  • Keynote: Replace Text under Document Warnings Gone?

    One of the most critical features I use in Keynote 5.3 on nearly a daily basis is VIEW > SHOW DOCUMENT WARNINGS > REPLACE TEXT for missing fonts.
    Is this feature gone?
    I'm in the process of testing out Keynote 6.1 to compile a list of all the bugs and missing features. So far it looks like when I open a file with missing fonts, I get a vague warning note that "some of the fonts are missing / might not appear correctly" but there doesn't appear to be any detail, or any option to replace them with other fonts.
    I hope I have overlooked something. Can anyone else weigh in on this, please?

    Try this repair for Keynote 6.2,  ensure you complete all the tasks and in the order shown:
    1  delete all the iWork applications if you have them, not just Keynote, using Appcleaner from Mac Update,
              its a freeware application
    2  restart the Mac;   Apple menu > restart
    3  immediately after the start chime,  press the shift key until you see the Apple symbol.
             let it fully boot up,  it will take longer as the OS is repairing the drive
    4  when fully booted, go to Applications > Utilities > Disc Utility;
              click on the boot drive  then First Aid tab and      click  repair disc permissions
    5  when complete, restart the Mac normally
    6  install Keynote from the Mac App Store
              Please report back to let us know if this helped.

  • Replace Text script returns error when dropped in automator

    Hi Friends,
    I have a series of pdfs that were saved with spaces in their file names. I need to put them into folders for a website (there's a lot). Pretty newbie on this too but I figured I'd try.
    I tried using the example script "Replace Text in Item names" which worked on it's own.
    (hd:applications:applescript:example scripts:finder scripts)
    When I applied it as an action in Automator, I would get an error about "expected end but found on."
    I think that resulted from the default script. So I deleted that. Put the replace script in.
    I cut out the dialog boxes and specified folders, search, and replacement items. And cut out the second half (after the beep)
    However as I step through, when I get to the script it returns the error: No result was returned from some part of this expression.
    So I'm not sure what I'm missing.

    It is hard to tell without seeing the mangled modified script. Your main problem is probably related to the run handler, which needs to be defined in Automator's Run AppleScript action. Every AppleScript has a run handler, but in the case of the Replace Text in Item Names it is implied (not explicitly defined). You will need to place the main statements of the script inside the Run AppleScript action on run handler, leaving the other handlers (for example, setitemname) outside of the run handler.

  • Applescript   replace text with clipboard

    Sorry if this has been asked before, I have been searching for hours and cannot find anything.
    what I would like to do is copy text from a safari webpage , swap to the textedit program and replace text with the copied contents.
    for eg.
    from safari I have copied the user link, I then want it to swap over to textedit, find the keyword "userlink" and replace it with the copied content from safari
    userlink
    email
    number
    HHopefully I have explained it correctly, and thanks in advance for any help

    Hi,
    Like this:
    set x to the clipboard as «class RTF »
    tell application "TextEdit"
        set first word of front document whose it = "userlink" to x
    end tell
    If you want plain text, remove as
    as «class RTF »

  • Use VBA and Excel to open Dreamweaver HTML (CS5), find and replace text, save and close

    I wish to use VBA and Excel to programmatically open numbered Dreamweaver HTML (CS5) and find and replace text in the code view of these files, save and close them.
    I have  5000 associations between Find: x0001 and Replace: y0001 in an Excel sheet.
    I have the VBA written but do not know how to open, close and save the code view of the ####.html files. Please ... and thank you...
    [email protected]

    This is actually the code view of file ####.html that I wish to find and replace programmatically where #### is a four digit number cataloguing each painting.... In 1995 I thought this was clever... maybe not so clever now :>)) Thank you for whatever you can do Rob!
    !####.jpg!
    h2. "Name####"
    Oils on acrylic foundation commercial canvas - . xx X xx (inches) Started
    Back of the Painting In Progress </p> </body> </html>
    Warmest regards,
    Phil the Forecaster, http://philtheforecaster.blogspot.ca/ and http://phils-market.blogspot.ca/

  • Trouble with "add note to replace text" annotation

    When I use "Add note to replace text" in Reader XI, the note acts as if it is locked even though it is not. The Locked box is not checked, but yet the options are grayed out; and I cannot delete the note, though I can edit the text box. "Strikethrough" and "Insert text at cursor" work fine.
    I am using the latest update of XI and have uninstalled and reinstalled it several times; I've also tried various older versions of XI. It happens with documents I've created or documents others have created; it happens on docs created from Word or those created from InDesign; it happens on docs downloaded several years ago as well as ones from the past month.
    I CAN delete these add-and-replace notes if I receive a file with them already put there by someone else--I just can't delete my own that I am adding right now. When I send the pdf to other people they have the same problem--in fact, someone told me that in her case ALL of my notes appear locked, not just the Add note to replace text one--yet when I send it to her, on my side, I have not locked any of them.
    Also, I do seem to be able to delete my own annotations I put on documents fairly recently--I have files from Sept 9 and Sept 17 that I can do this. But if I try to add notes to those same docs now, they act just like all the other ones--I cannot delete those particular notes and they appear locked.
    Help please!!

    You could write an html-text file that revers to the image file
    after that you could even convert this html-file to an rtfd file (which is a package after all) using textutil

  • Find and Replace text string in HTML

    Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
    with "YYYYY"
    I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
    [email protected]

    Hello Phil,
    The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
    questions there.
    If you decide to develop an Outlook macro on your own, the
    Getting Started with VBA in Outlook 2010 article is a good place to start from.

  • Find and replace text in multiple Photoshop files?

    Hi there,
    Let us say I have six Photoshop files: 1.psd, 2.psd, ..., 6.psd. All of these files contain the word “LoremIpsum” in random text layers, within each document. Is there a way I can search for “LoremIpsum” in all documents and replace it with “Dolor Sit Amet”, all in one go? This is just an example, I need to replace various words, not just one.
    I have tried "batch find and replace" software (including powerful tools like Power Grep) but they do not work with psd files… Is there a javascript of external plugin for this kind of task?
    Thanks!

    You’re welcome, advice given here is free.
    If you want to donate something nonetheless you could do so over at
    http://ps-scripts.com/bb/
    Many of the same people used to contribute there as here and I for one have benefitted considerably from their generous advice on Scripting issues.
    A Script can read (or create) txt files, but I do not have a lot of experience with this.
    This might work (amend the line »var theTexts = readPref ("….txt", false);« according to your txt-file’s path):
    // replace text elements in type layers;
    // 2013, use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
              for (var n = 0; n < app.documents.length; n++) {
                        app.activeDocument = app.documents[n];
                        app.activeDocument.suspendHistory("replace text", "main()")
    // the opertation;
    function main () {
              var myDocument = app.activeDocument;
              var theTexts = readPref ("….txt", false);
              var theArray1 = theTexts.slice(0, Math.round(theTexts.length/2));
              var theArray2 = theTexts.slice(Math.round(theTexts.length/2), theTexts.length);
              alert (theArray1.join("\n")+"\n\n\n"+theArray2.join("\n"))
              for (var b = 0; b < theArray1.length; b++) {
                        replaceText (theArray1[b], theArray2[b])
    ////// reoplace text //////
    function replaceText (replaceThis, replaceWith) {
    // =======================================================
    var idreplace = stringIDToTypeID( "replace" );
        var desc22 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref3 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idreplace = stringIDToTypeID( "replace" );
            ref3.putProperty( idPrpr, idreplace );
            var idTxLr = charIDToTypeID( "TxLr" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idAl = charIDToTypeID( "Al  " );
            ref3.putEnumerated( idTxLr, idOrdn, idAl );
        desc22.putReference( idnull, ref3 );
        var idUsng = charIDToTypeID( "Usng" );
            var desc23 = new ActionDescriptor();
            var idfind = stringIDToTypeID( "find" );
            desc23.putString( idfind, replaceThis );
            var idreplace = stringIDToTypeID( "replace" );
            desc23.putString( idreplace, replaceWith );
            var idcheckAll = stringIDToTypeID( "checkAll" );
            desc23.putBoolean( idcheckAll, true );
            var idFwd = charIDToTypeID( "Fwd " );
            desc23.putBoolean( idFwd, true );
            var idcaseSensitive = stringIDToTypeID( "caseSensitive" );
            desc23.putBoolean( idcaseSensitive, false );
            var idwholeWord = stringIDToTypeID( "wholeWord" );
            desc23.putBoolean( idwholeWord, false );
            var idignoreAccents = stringIDToTypeID( "ignoreAccents" );
            desc23.putBoolean( idignoreAccents, true );
        var idfindReplace = stringIDToTypeID( "findReplace" );
        desc22.putObject( idUsng, idfindReplace, desc23 );
    executeAction( idreplace, desc22, DialogModes.NO );
    ////// read prefs file //////
    function readPref (thePath, binary) {
      if (File(thePath).exists == true) {
        var file = File(thePath);
        file.open("r");
        if (binary == true) {file.encoding= 'BINARY'};
        var theText = file.read();
        file.close();
        return String(theText).split(",")
    In this case the comma is used to split the text into Strings in Arrays, if your search/replace texts include commas you could use something else, I guess.

  • Replacing text in a text file with special characters

    Hi all,
    in my test text file i found an interesting issue, where i can't replace text that looks something like this "New Text Document - Copy (2).txt"
    (gc $logeps)|foreach{$_ -replace "$($file.name)",""}|Out-File $logeps
    the context of my $($file.name) is "New Text Document - Copy (2).txt"
    how can i escape the parentheses characters inside of a variable that i am passing?
    thanks

    That should work if you're running PowerShell 3.0 or later, but in older versions, you'd run into errors if you try to run .Replace on an array of strings.
    While I prefer the string .Replace method in this instance, for future reference, if you want to escape a literal string so it can be used in a regular expression, call the [regex]::Escape method:
    $pattern = [regex]::Escape($file.Name)
    (gc $logeps) -replace $pattern | Out-File $logeps

  • Replace text in photoshop document & save

    Hello,
    I have to make apprieciation certificates for a committee. Is there a way to use Automator to replace text within a photoshop document (people's names) and then save each name in a different file?
    Thanks!

    In theory, at least, this should be possible through an AppleScript which could be part of an Automator workflow, at least with Photoshop CS4 (I don't have earlier versions to check in their scriptability). The AppleScript suite for Photoshop CS4 has a text-object function that offers a lot of control over a given block of text, so it looks like it would be doable. You might want to take this up in the AppleScript forum or, probably better, in Adobe's own Photoshop forum.
    Regards.

  • Search & replace text programmatically in pdf file

    I need to search & replace text programmatically (preferably in .NET c#) in existing pdf file.
    Does anyone know how to do it (maybe with with Acrobat SDK) ?
    Thanks in advance!
    A.
    PS: Well done working example :-)

    Searching APIs are provided, but there no APIs for replacing since that's not a standard operation on a PDF (given the rendering model).

  • Use Powershell to replace text with image in Word document

    I have a powershell script that uses a Word document as a template to create signatures that I am pushing out to my organization.
    The document is populated with text formatted the way I want the signature to look, that I then do a FindText and ReplaceText on.  This works fine for replacing text with text, but I can't figure out how to properly replace some of the holder text with
    an image and a link.  I found a few posts about adding images to word documents, but none that seem to work properly in this scenario.
    Any insight would be greatly appreciated, thanks!

    Dear BOFH,
    You are correct that method I outlined is not for inserting an image into a signature block (which would be in Outlook, not Word).  The links you post do certainly deal with outlook signatures, well done... Except that the question was about how to
    use a Powershell script to replace text in a Word document with an image.  Sure it was framed in the context of creating signatures, but the poster expressed that they already had a method of generating and replacing text, and just needed to know, as
    I did, how to do the thing they actually asked.
    Please BOFH... Please forgive my audacity in hoping to find a reference (any reference) to how to replace Word text with images via Powershell in a thread titled "Use Powershell to replace text with image in Word document".
    This is certainly a scripting question, and even something as simple as "You will need to call the .NET methods for the Word find/replace functionality.  Please ask in the Word forums for the correct method to use. 
    If you need help on calling .NET methods look HTTP ://here"support you offered combined with the contempt you offer in response to my actual substantive help to the actual question asked.
    BOFH, you are not better than us, just more arrogant.
    Can you please start your own question as this one has been closed.  Please see scripting guidelines.
    We cannot guarantee you satisfaction as this is a user supported forum.  The is no SLA for community support.  Perhaps if you posted a better worded question as a new topic someone might be able to help you resolve your issue.
    The topic you are posting on is closed and answered.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • Links no longer work after signing document

    Links no longer work after signing document - I have updated to latest version and run installation repair, is this a problem or is it supposed to do that?

  • Office network design ideas..

    Hey all, we are upgrading to a Cisco network and wanted some input on our possible network design... Currently we have: A Juniper SSG 140 and IDP for our firewall and IDS 3com (layer2/3) switches for our desktops 2 Dell PowerConnect 5424 switches for

  • Field in a Query

    Hi All, This is in BI 7.0 We have output in the Cube like Calday             No of Trans   Time Spnt (Minutes) 1.1.2009               1                  20 1.1.2009               2                  40 1.1.2009               3                  90 1.2.

  • Cannot sync anymore - computer crashed

    computer crashed - cannot sync anymore. itunes asks to re-authorize and then tells me my computer is already authorized. and then asks to re-authorize. De-authorizing causes the deletion of all iphone programs can anyone help me?

  • How to unsync and recover original contacts and messages to iPhone

    How to unsync and recover original contacts and messages to iPhone 4?