Replacing inconsistant spacing with single space in a string

is it possible to replace multiple spaces within a string with one space only. Number of spaces is different all the time.
say one field contains strings with imbedded spaces
I need to replace all these values so that there will be only one space between words.
For Eg.
Input                             Expected Result
aaa    bbb                       aaa bbb
ww                vv             ww vv
ww ss      kk                    ww ss kk
[/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

user11253970 wrote:
I am in Oracle 9i :( I can not use reg exp
Assuming strings do not contain CHR(0) (character with ascii code 0):
SQL> SELECT  'aaa          bbb  aaa bbb' str,
  2          replace(replace(replace('aaa          bbb  aaa bbb',' ',' ' || CHR(0)),CHR(0) || ' '),CHR(0)) new_str
  3    FROM  dual
  4  /
STR                                 NEW_STR
aaa          bbb  aaa bbb           aaa bbb aaa bbb
SQL> SY.

Similar Messages

  • Replacing many spaces with single space in a string

    Hi!
    I have the following strings:
    "Eric       B"
    "John                 A"
    "Mary Anne   C"But I want them to be like this:
    "Eric B"
    "John A"
    "Mary Anne C"Do anyone have an idea how to do this?
    Edited by: suladna on Aug 2, 2008 5:42 AM

    Use this:
    String s = "Mary    Anne   C";
    System.out.println(s.replaceAll("\\s+", " "));Edited by: prigas on Aug 2, 2008 6:15 AM

  • Firefox is replacing double quotes with single quotes.

    In WordPress and at other sites where I input and save text, Firefox is replacing double quotes with single quotes when I save. It's also showing double quotes as single quotes on websites. I tried uninstalling and reinstalling, and it's still happening.

    Do you have the needed font installed?
    *http://en.wikipedia.org/wiki/Punctuation

  • Spacing with fixed space fonts

    Using RoboHelp for Word 6, Build 099 for a large Help
    project. We are converting from WinHelp to HTML Help. One topic
    consists of a large block of text (lots of columns in a fixed space
    font - Courier New) with popups annotating the text.
    With WinHelp the vertical allignment is fine. When the HTML
    Help is compiled, multiple spaces appear to be compressed to a
    single space making the output unreadable.
    For example we get :
    |===============================================|
    | |
    | Developed by |
    | |
    | XP Software |
    | |
    |===============================================|
    | XP Software November, 2004 |
    | Data File Version ---> 11.7 |
    | Serial Number: 42-xxx-0000 |
    | XP Software (Evaluation) |
    *===============================================*
    Multiple spaces are need to make the right end of the boxes
    line up. Columns with numbers are worse.
    Is there any way to compile forcing the multiple spaces to
    remain?

    TEB008 -
    In Word, highlight the topic, and do a Word search-n-replace
    of spaces with no-break spaces. You'll see those options in the
    s-n-r box when you click the MORE button.

  • Replacing " (double quote) with ' (single quote)

    Hi there,
    I have the following method to manipulate user input. All I want to do is, to replace the double quote with a single quote. The implementation I tried was,
    this.replace(desc, "\"", "'");
    This does not work for me. It jsut removes the double quote and does not introduces the single quote. Could any one please advise?
    Thanks,
    Des
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
         }

    Bad luck.. I am unable to get it still.
    This is the code I am using (implemetation is in a JSP. I am using this code to test it).
    public class Test{
    public static void main(String args[]){
         String s = args[0];
         Test t = new Test();
         String doubleQuote = "\"";
         System.out.println(" output :"+ t.replace(s,doubleQuote,"'"));
         //System.out.println(" output :"+ t.replace(s,"\"","'"));
         //System.out.println(" output :"+ t.replace('"', '\''));
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                             System.out.println(" line count :");
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
    }mshn02
    The main problem is I am stuck with the server's version of Java (which I have no control on it). I could not use 1.4.2

  • Mail in 10.6.3 doing double or triple spacing with single "return"

    I got a new MBP with OX 10.6.3. I've never experienced this problem with 10.5.8 on my previous laptop, and a call to Apple support has not solved it yet (either they never heard it or it's unique to me). Figured I'd ask the community.
    In the Mail program, I can click reply or forward to a message in the inbox, manually highlight my signature, hit delete key (to remove signature), type the first line (such as, "dear so-and-so,") and hit the return key once.
    Mail will sometimes drop in 2 or 3 blanks lines with that single press of the return key. When then hit the delete key, it will step backwards one line at a time.
    This does not happen when I click reply/forward and use the signature pop-up menu set to "none." It only happens when I manually highlight my signature and press delete to remove it.
    It doesn't happen every time either (very odd). I can do a test reply to the same message repeatedly and see it happen 30% to 50% of the time.
    I can reproduce the problem by replying to different emails (so the problem doesn't seem to be tied to the sender's email address or the content of the email I'm replying to/forwarding).
    My signature is plain text. It looks like this:
    (blank line for visual space)
    Let me know if I can be of further assistance.
    -My Name
    (2 blank lines for visual space)
    My Name
    My Company
    My Address Line 1
    My Address Line 2
    My email
    My web address
    My phone
    My fax
    (blank line for visual space)
    Another strange tidbit. If I remove the blank line at the END of my signature, the problem goes away. Yet, if I leave the blank line at the END of my signature, I don't see the problem when I compose a NEW message (only with reply/forward).
    It's almost as if the blank line at the end of the signature causes the problem only when there is quoted content.
    And one final piece of strangeness. If I go into my signature, remove the blank lines at the end of the signature text, and add a SINGLE blank line after my fax# and close the preferences... now re-open the preferences, the Mail program has added a SECOND blank line after my fax# all by itself.
    I tried removing the signatures folder from home > library > mail (thought it might be corrupted file or something), but the problem persists. I tried deleting the signature within Mail and re-creating it, typing it in manually, but the problem persists.
    I have not yet experimented with new accounts/users. I've never used the Automator script program.
    Any thoughts?
    Message was edited by: mrcatman

    I got a new MBP with OX 10.6.3. I've never experienced this problem with 10.5.8 on my previous laptop, and a call to Apple support has not solved it yet (either they never heard it or it's unique to me). Figured I'd ask the community.
    In the Mail program, I can click reply or forward to a message in the inbox, manually highlight my signature, hit delete key (to remove signature), type the first line (such as, "dear so-and-so,") and hit the return key once.
    Mail will sometimes drop in 2 or 3 blanks lines with that single press of the return key. When then hit the delete key, it will step backwards one line at a time.
    This does not happen when I click reply/forward and use the signature pop-up menu set to "none." It only happens when I manually highlight my signature and press delete to remove it.
    It doesn't happen every time either (very odd). I can do a test reply to the same message repeatedly and see it happen 30% to 50% of the time.
    I can reproduce the problem by replying to different emails (so the problem doesn't seem to be tied to the sender's email address or the content of the email I'm replying to/forwarding).
    My signature is plain text. It looks like this:
    (blank line for visual space)
    Let me know if I can be of further assistance.
    -My Name
    (2 blank lines for visual space)
    My Name
    My Company
    My Address Line 1
    My Address Line 2
    My email
    My web address
    My phone
    My fax
    (blank line for visual space)
    Another strange tidbit. If I remove the blank line at the END of my signature, the problem goes away. Yet, if I leave the blank line at the END of my signature, I don't see the problem when I compose a NEW message (only with reply/forward).
    It's almost as if the blank line at the end of the signature causes the problem only when there is quoted content.
    And one final piece of strangeness. If I go into my signature, remove the blank lines at the end of the signature text, and add a SINGLE blank line after my fax# and close the preferences... now re-open the preferences, the Mail program has added a SECOND blank line after my fax# all by itself.
    I tried removing the signatures folder from home > library > mail (thought it might be corrupted file or something), but the problem persists. I tried deleting the signature within Mail and re-creating it, typing it in manually, but the problem persists.
    I have not yet experimented with new accounts/users. I've never used the Automator script program.
    Any thoughts?
    Message was edited by: mrcatman

  • Replacing Selected Areas with White Space

    I am using Acrobat version 8 on an XP Pro SP2 system.
    I have a PDF file. Certain selected areas I wish to replace with pure white space. How can I do that?

    You will find other ways which SEEM to remove blank material but avoid
    them like the plague since it is very easy to get back the hidden
    material. Redaction needs specialist tools. There is a plug-in, Redax
    from http://www.appligent.com/
    Aandi Inston

  • Replace tab indents with em space indents?

    Hi all!
    I'm laying out a book whose chapters were all initially created in Word using Tab indents. I tried to do a find and replace within InDesign to change the tab indents to em spaces, but both Word and Indesign don't register the tab spaces as highlight-able, so the find and replace found nothing when I looked for "^t".
    Anyone know how to do this?
    Thank you!
    Alec

    So, they're not tabs. Check the Paragraph settings for one of them -- I bet you find a First Line Indent of other than 0.
    If Word behaved itself, and the document was imported nicely, you might find all indented paragraphs have the same paragraph style applied to them. If so, just change the value for the First Line Indent in that paragraph style, and you're done.
    If not, you have something to do to-night! Unfortunately, although InDesign
    i can
    search for a specific indent value and replace it with another, it's impossibly hard to get the correct value to search for. That's due to rounding in the input boxes -- a value you see as "12.5pt" might be internally stored as "12.4999pt", so if you search for "12.5" it doesn't find anything. No point fiddling about; create a new paragraph style (this time with a good indent value), and apply it manually to the ones you want changed.
    Incidentally, you can't specify measurements in InDesign in em units. For a 1 em indent I generally choose either the text point size, or the leading -- this tends to look better if the leading is way big. If neither looks okay, I make up something that
    i does.

  • ACS - Replace IP Subnet with Single IP's

    Hi Everyone,
    I have been charged with a task to create individual entries in our ACS for each of our network devices. I am new to the ACS and the documentation does not seem to cover this scenario. Right now we have all our devices fall under a single subnet.
    When I try to create a device within the subnet, it tells me IP subnets overlap with those defined for device.
    If I try to change the existing IP Subnet to an IP range so I can exclude some devices from the IP Subnet, it tells me I cannot switch from IP Mask mode to IP Range mode.
    I am guessing I need to delete the the record for the IP subnet and add each device back individually. My concern is that none of my devices will work until I add each one back.
    Is this correct or is there a better way to go about this?
    Thanks,
    DC

    You can configure the default network device with the same settings ad your subnet, remove the subnet definition and re-add the hosts one by one. You can also use file import to reduce time.
    Sent from Cisco Technical Support Android App

  • Replace characters between with single * in variable

    Hi Experts ,
    I want to replace all characters between <  > with *. Data is stored in variable type char255.
    Example ,
    Suppose variable contains : Wage Type <Wage Type> Not Valid For Interface ID <ID>
    I want output as Wage Type * Not Valid For Interface ID *.
    Thanks & Regards ,
    Jigar Thakkar

    Hi Jigar,
    Find the length of the string and use DO...ENDDO statement. Inside the loop, didnt consider the text between < and > and move to another string and add * when  > is encountered in the string.
    data:
      gv_len type i,
      gv_str type string value 'Wage Type <Wage Type> Not Valid For Interface ID <ID>',
      gv_rep_str type string,
      gv_flag type char1,
      gv_index type sy-index.
    gv_len = strlen( gv_str ).
    do gv_len times.
    gv_index = sy-index - 1.
    if gv_str+gv_index(1) = '<'.
    gv_flag = 'X'.
    continue.
    elseif gv_str+gv_index(1) = '>'.
    clear gv_flag.
    concatenate gv_rep_str '*' into gv_rep_str.
    continue.
    elseif gv_flag is initial.
    concatenate gv_rep_str gv_str+gv_index(1) into gv_rep_str.
    endif.
    enddo.
    write:/ gv_rep_str.
    Thanks,
    Vinay
    Edited by: Vinaykumar G on May 29, 2009 8:04 PM

  • Replacing multiple nodes with single node in OSB

    Hi,
    I have a case where I will get a xml like below:
    <LINEITEMS>
         <LINE_ITEM>
              <LINE_ITEMNO>1</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE1</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>3</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE3</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>1</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE2</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>3</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE4</MESSAGE>
         </LINE_ITEM>
    <LINE_ITEM>
              <LINE_ITEMNO>2</LINE_ITEMNO>
              <STATUS_CODE>1</STATUS_CODE>
              <MESSAGE>MESSAGE5</MESSAGE>
         </LINE_ITEM>
    </LINEITEMS>
    I need to make this as below:
    <LINEITEMS>
         <LINE_ITEM>
              <LINE_ITEMNO>1</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE1;MESSAGE2</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>3</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE3;MESSAGE4</MESSAGE>
         </LINE_ITEM>
    <LINE_ITEM>
              <LINE_ITEMNO>2</LINE_ITEMNO>
              <STATUS_CODE>1</STATUS_CODE>
              <MESSAGE>MESSAGE5</MESSAGE>
         </LINE_ITEM>
    </LINEITEMS>
    I need to have only one entry for each line Item.
    Please let me know on the approach on how to do it in OSB.
    Thanks

    You can try this :-
    let $out:= <LINEITEMS>{ for $x in 1 to count($input/LINE_ITEM)
                                  let $LineItme := $input/LINE_ITEM[$x]/LINE_ITEMNO
                             let $match:= for $y in $x to count($input/LINE_ITEM)
                                  where $input/LINE_ITEM[$y]/LINE_ITEMNO= $LineItme
                                  return $input/LINE_ITEM[$y]/MESSAGE
                                  return
                                  <LINE_ITEM>
                                       <LINE_ITEMNO>{$LineItme/text()}</LINE_ITEMNO>
                                       <STATUS_CODE>{data($input/LINE_ITEM[$x]/STATUS_CODE)}</STATUS_CODE>
                                       <MESSAGE>{fn:data($match)}</MESSAGE>
                                  </LINE_ITEM>
    }</LINEITEMS>
    return $out
    You many then have to remove duplicates with line items. use fn:distinct() and then loop through.

  • How can i replace a blank with a space

    i wanna take a string and place spaces between each letter but leaving the origional spaces
    how would i do something like this
    (ex. input: my name is sam
    exput: m y n a m e i s s a m )

    i suggest you read the damned tuts. your questions are pitifully simple. a simple search (see that search field on the right?) will answer every question you've asked. it doesn't seem as if you have experimented one bit.
    problem
    ask for help
    new problem
    ask for help
    new problem
    ask for help
    i think i see a pattern. it says you are stupid and lazy and are afraid to experiment or try to learn on your own.

  • Word 2008 line spacing.. is single space and double space all messed up?

    Very basic here: in print layout view (only one I am using) the single spacing and double spacing seem so far apart. Single spacing is way too far apart. Is anyone else seeing this?

    That is the issue. I am hitting enter and getting a big space. I see a similar thing in Pages. All I know is tht in 2004 version, I start all my papers with 4 lines in top corner (name-enter/date-enter/assignment/class#-enter) I do these with single space just by default on Word.
    THen I go to format-paragraph-double space, and do my writing--double spaced.
    This is weird to me. I like word 2008, looks nice, notebook is cool. But I don't like having to re-learn that stuff. Is this how everybody does this? Everyone out of the box can not just type and choose single/double space? We have to edit some paragraph spacing? HUH?

  • Find Replace from Textfile with regex

    Hello.
    I'm wondering if anyone knows about an existing script that does a find/replace by list like the script "FindChangeByList.jsx" that comes with every InDesign installation.
    This consists of tow parts, the script itself with the functionality and a simple textfile where you have simple one-liners capable of find/replace with regex.
    the Textfile:
    //FindChangeList.txt
    //A support file for the InDesign CS4 JavaScript FindChangeByList.jsx
    //This data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text          {findWhat:"--"}          {changeTo:"^_"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double dashes and replace with an em dash.
    //More complex example:
    //text          {findWhat:"^9^9.^9^9"}          {appliedCharacterStyle:"price"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    grep          {findWhat:"  +"}          {changeTo:" "}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double spaces and replace with single spaces.
    grep          {findWhat:"\r "}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a space And replace with single returns.
    grep          {findWhat:" \r"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a space and replace with single returns.
    grep          {findWhat:"\t\t+"}          {changeTo:"\t"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double tab characters and replace with single tab characters.
    grep          {findWhat:"\r\t"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a tab character and replace with single returns.
    grep          {findWhat:"\t\r"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a tab character and replace with single returns.
    grep          {findWhat:"\r\r+"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double returns and replace with single returns.
    text          {findWhat:" - "}          {changeTo:"^="}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all space-dash-space and replace with an en dash.
    text          {findWhat:"--"}          {changeTo:"^_"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all dash-dash and replace with an em dash.
    The script:
    //FindChangeByList.jsx
    //An InDesign CS5.5 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 3.0.0 15 December 2009
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text          {findWhat:"--"}          {changeTo:"^_"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double dashes and replace with an em dash.
    //More complex example:
    //text          {findWhat:"^9^9.^9^9"}          {appliedCharacterStyle:"price"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
              var myObject;
              //Make certain that user interaction (display of dialogs, etc.) is turned on.
              app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
              if(app.documents.length > 0){
                        if(app.selection.length > 0){
                                  switch(app.selection[0].constructor.name){
                                            case "InsertionPoint":
                                            case "Character":
                                            case "Word":
                                            case "TextStyleRange":
                                            case "Line":
                                            case "Paragraph":
                                            case "TextColumn":
                                            case "Text":
                                            case "Cell":
                                            case "Column":
                                            case "Row":
                                            case "Table":
                                                      myDisplayDialog();
                                                      break;
                                            default:
                                                      //Something was selected, but it wasn't a text object, so search the document.
                                                      myFindChangeByList(app.documents.item(0));
                        else{
                                  //Nothing was selected, so simply search the document.
                                  myFindChangeByList(app.documents.item(0));
              else{
                        alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
              var myObject;
              var myDialog = app.dialogs.add({name:"FindChangeByList"});
              with(myDialog.dialogColumns.add()){
                        with(dialogRows.add()){
                                  with(dialogColumns.add()){
                                            staticTexts.add({staticLabel:"Search Range:"});
                                  var myRangeButtons = radiobuttonGroups.add();
                                  with(myRangeButtons){
                                            radiobuttonControls.add({staticLabel:"Document", checkedState:true});
                                            radiobuttonControls.add({staticLabel:"Selected Story"});
                                            if(app.selection[0].contents != ""){
                                                      radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
              var myResult = myDialog.show();
              if(myResult == true){
                        switch(myRangeButtons.selectedButton){
                                  case 0:
                                            myObject = app.documents.item(0);
                                            break;
                                  case 1:
                                            myObject = app.selection[0].parentStory;
                                            break;
                                  case 2:
                                            myObject = app.selection[0];
                                            break;
                        myDialog.destroy();
                        myFindChangeByList(myObject);
              else{
                        myDialog.destroy();
    function myFindChangeByList(myObject){
              var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
              var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
              var myStartCharacter, myEndCharacter;
              var myFindChangeFile = myFindFile("/FindChangeSupport/FindChangeList.txt")
              if(myFindChangeFile != null){
                        myFindChangeFile = File(myFindChangeFile);
                        var myResult = myFindChangeFile.open("r", undefined, undefined);
                        if(myResult == true){
                                  //Loop through the find/change operations.
                                  do{
                                            myLine = myFindChangeFile.readln();
                                            //Ignore comment lines and blank lines.
                                            if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")|| (myLine.substring(0,5)=="glyph")){
                                                      myFindChangeArray = myLine.split("\t");
                                                      //The first field in the line is the findType string.
                                                      myFindType = myFindChangeArray[0];
                                                      //The second field in the line is the FindPreferences string.
                                                      myFindPreferences = myFindChangeArray[1];
                                                      //The second field in the line is the ChangePreferences string.
                                                      myChangePreferences = myFindChangeArray[2];
                                                      //The fourth field is the range--used only by text find/change.
                                                      myFindChangeOptions = myFindChangeArray[3];
                                                      switch(myFindType){
                                                                case "text":
                                                                          myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                                                          break;
                                                                case "grep":
                                                                          myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                                                          break;
                                                                case "glyph":
                                                                          myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                                                          break;
                                  } while(myFindChangeFile.eof == false);
                                  myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
              //Reset the find/change preferences before each search.
              app.changeTextPreferences = NothingEnum.nothing;
              app.findTextPreferences = NothingEnum.nothing;
              var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
              myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
              myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
              app.doScript(myString, ScriptLanguage.javascript);
              myFoundItems = myObject.changeText();
              //Reset the find/change preferences after each search.
              app.changeTextPreferences = NothingEnum.nothing;
              app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
              //Reset the find/change grep preferences before each search.
              app.changeGrepPreferences = NothingEnum.nothing;
              app.findGrepPreferences = NothingEnum.nothing;
              var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
              myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
              myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
              app.doScript(myString, ScriptLanguage.javascript);
              var myFoundItems = myObject.changeGrep();
              //Reset the find/change grep preferences after each search.
              app.changeGrepPreferences = NothingEnum.nothing;
              app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
              //Reset the find/change glyph preferences before each search.
              app.changeGlyphPreferences = NothingEnum.nothing;
              app.findGlyphPreferences = NothingEnum.nothing;
              var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
              myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
              myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
              app.doScript(myString, ScriptLanguage.javascript);
              var myFoundItems = myObject.changeGlyph();
              //Reset the find/change glyph preferences after each search.
              app.changeGlyphPreferences = NothingEnum.nothing;
              app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
              var myScriptFile = myGetScriptPath();
              var myScriptFile = File(myScriptFile);
              var myScriptFolder = myScriptFile.path;
              myFilePath = myScriptFolder + myFilePath;
              if(File(myFilePath).exists == false){
                        //Display a dialog.
                        myFilePath = File.openDialog("Choose the file containing your find/change list");
              return myFilePath;
    function myGetScriptPath(){
              try{
                        myFile = app.activeScript;
              catch(myError){
                        myFile = myError.fileName;
              return myFile;
    This is a very useful and easy to maintain script which even people who cant write scripts (but know how to use regex) can do complex search replace mass replacements.
    Would love to find something like this for FrameMaker 12 (as i can't write scripts myself).
    regards
    daniel

    I have visited that site. The first item in the external link says: "You can also configure Firefox to automatically search for text when you type any characters outside of a text field. When typing in a text field these characters should show up in the text field and not trigger the Quick Find bar. "
    What I am looking for is the exact opposite. Once my first search is entered in the text box, and the info comes back, I want to start typing the next symbol, and have it automatically show up in the text box, not the Quick Find box. That is how it was working up until a couple of months ago.

  • When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single and 10pt. It just started doing this a month ago. It does not do it when I am on my laptop or using Explorer. Help, I hate explorer.

    When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single space and 10pt.
    It just started doing this a month ago.
    It does not do it when I am on my laptop or using Explorer.
    Help, I hate explorer.

    If this were a project that I was involved in, I would recapture the media at the correct frame rate and rebuild the sequences correctly.
    Moving from production, to post production, to delivery is a series of steps, and the success of any particular step is based on having all the preceding steps done correctly.
    Shortcuts and workarounds tend to create awkward and difficult problems, that often only surface late in the process.
    MtD

Maybe you are looking for

  • Unable to update to 10.4.7

    I am currently running 10.4.3 on my PPC mac mini 1.4 ghertz. Whenever i try to update with software update I get an error message: "The update "Mac OS X Update combined (PowerPC)" can't be installed. Sorry, an unexpected error has ocurred. The instal

  • I cannot add or change a time on an alarm

    I want to set an alarm for a specific time, but there are no options available to edit the time in any way. It lets me set an alarm and gives me the option to have an alarm go off 15 minutes before, hour before, etc. However, it doesn't let me set a

  • Copy Tiger Classic Support into Leopard Possible?

    I tried asking this in Leopard's pre-release forum and the responses were, shall we say "less than helpful." Before you answer (noting that this is the "Classic Environment" discussion group), I am well aware OS 9 is dead (duh), I have an expensive C

  • Migration help... from Powerbook G4 12" 1.5 to Macbook Pro 13" 2009 2.26

    Hi all. My first post here. Finally I took advantage of the educational discount today and bought myself a MBP 13". Coming from Powerbook g4 12" 1.5 ghz, this is a major upgrade. Really Excited about it, but I have some questions. When I asked a sale

  • Safari runs slow

    Since installing Mountain Lion on my iMac, it seems that Safari is running slower and slower. It seems to find the site I want to visit, then loads a small amount of data, then sits for a long period of time and loads the rest quickly. I have also in