Matching a string of text with another

Hello Gurus
I have what is hopefully a fun problem for someone to help me solve. I was unable to find the relevant commands in the ABAP dictionary and am not the best at ABAP anyway!
We have field with properties:
/BIC/OZBARCODE
Data Type  NUMC
Length     20
In reality the data in this field should be 13 characters long and we are not interested in strings that are not this length.
From the remaining data we want to compare characters 8-12 to another text string, lets call it ABCDE. We are then only interested in those that match.
eg
if there were three values for /BIC/OZBARCODE:
ABCDE
ABCDEXXXXXXXX
XXXXXXXABCDEX
ABCDE - would be deleted as of the wrong length
ABCDEXXXXXXXX - would be deleted as the relevant string does not fall in the right place
XXXXXXXABCDEX - would be kept
No need to give me the whole code, I just need the bits that will say:
If length of /BIC/OZBARCODE = 13
and
if characters 8-12 of /BIC/OZBARCODE = ABCDE
Many thanks in advance for any help.
Tom

Hello Tom,
you basically will need the strlen( ) operator for getting the length of the string and an offset operation to compare the substring.
  DATA: lv_string(20) TYPE c,
        ln_length     TYPE i.
lv_string = 'XXXXXXXABCDEX'.
ln_length = strlen( lv_string ).
IF ln_length NE 13 or
   lv_string+7(5) NE 'ABCDE'.
  " throw the value away
ELSE.
  " keep the value
ENDIF:
The trouble you will face in your setting is that the field is no string but a numeric character. These fields should be right aligned and cannot contain spaces or letters so the length should always be 20. Furthermore they are right alligned and filled with zeros so if zeros are allowed characters from the business view you might not be able to get the length of the string for sure.
Kind Regards
Roman

Similar Messages

  • How do you match the audio and text with the typer writer effect in Final Cut Pro?

    I am making a video and I want to sync up the text with the audio using the typer writer effect.  For example I want when the music makes a bing noise I want a letter to pop up.  How do you set the exact time for each letter that comes up instead of just choosing the duration.
    Thank you!!!!
    Virginia

    The most common cause is user error in understanding how these things are recorded in the acquisition system. You've got to first determine in it's easily solved by properly transcoding or if you're actually just seeing a display lag. Mismatched sync is based on different timebase scales so the offset gets worse the longer a clip plays.
    The most common solution is to unlink the components, time them precisely to the frame, and change the speed of one component to match precisely the length of the other. It's easy and usually results in a slight pitch change that is indiscernible.
    But you want to figure out the cause, not just he solution, so you can fix it in production instead of in post.

  • Is there a good way to replace the "view cart" text with another text?

    I have this big issue i'm still stuck with, i hope someone can help me.
    I need to change the text "view cart" in the cart-summary module. I have learned that i can do this with javascript: http://forums.adobe.com/message/4409239#4409239
    But there are problems:
    When i use this javascript:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script>
    $(function () {
      $(".cartSummaryLink").text("Afrekenen");
    $(function () {
      $(".cartLink").text("Winkelwagen is geleegd");
    </script>
    The "view cart" is replaced with "afrekenen".
    BUT:
    When i add another product in the large product layout the text "view cart" is back...
    When i delete a product in the cart  the "view cart" text is also back
    When i refres the page the "view cart" text is replaced again with "afrekenen"
    So i thought, to use some javascript to refresh the page when a product is added:
    <script type="text/javascript">
    function AddProductExtras(){
    document.location.reload(true);
    </script>
    This works but you can see that the text changes from "afrekenen" to "view cart" and back to "afrekenen" Also the page is rebuild again which is not a very good solution.  So here are my questions:
    Is there a better work around?
    If not, is there a way that when a product is deleted in the cart the page can also be refreshed?
    Thanks,
    Frank

    Hello Mario,
    Here's my site where i'm working on:
    http://grootaartseuronics.businesscatalyst.com/index.html
    The cartsummary module is located at the right sitebar.
    The code is:
    <div id="plh_winkelwagen">
    <div class="cart-summary">{module_shoppingcartsummary,vertical,}</div>
    </div>
    The CSS is:
    #plh_winkelwagen {
    float: right;
    width: 160px;
    height: 100px;
    margin: 20px;
    background-color: #FFC;
    background-image:url(../Images/Winkelmandje_nieuw_25.png);
    -webkit-border-radius: 15px; /* Safari */
    -webkit-border-radius: 15px; /* Safari */
    -moz-border-radius: 15px; /* Firefox */
    -moz-border-radius: 15px; /* Firefox */
    border-radius: 15px; /* CSS */
    border-radius: 15px; /* CSS3 */
    .shop-main .cart-summary {
    float: right;
    width: 40%;
    So with your solution I should remove the background plh_winkelwagen en create or put it in the a.cartsummarylink? Or should i keep the plh-winkelwagen and just add your solution. I can create a png the same size as the: winkelmandje_nieuw_25.png with the "afrekenen" text in it?
    Thanks,
    Frank

  • Link a text with another sheet

    Hello!! 
    Is there a opportunity in Diadem to make a link in one Report sheet on a textbox? The link should go to another sheet and show me the content of it. 
    Best regards, 
    Mosquito

    Hi Mosquito,
    wenn ich dich richtig verstehe möchtest du auf einer der Report Seiten irgendetwas von einer anderen Report-Seite anzeigen lassen.
    Was genau möchtest du denn bitte angezeigt bekommen?
    Abduelkerim
    Sales
    NI Germany

  • Extract specific letters from a string of text

    Hello,
    I have an idea that I would like to implement into Numbers but I'm not quite sure how to do it, or even if it is possible. What I would like to do is replace a multitude of checkboxes with one cell. In that one cell I will have a string of text, with a letter representing a condition. From this one cell, I would like to be able to extract a certain letter into its own cell and then hide the multitude of cells.
    My idea is to eventually just be able to type the conditions into a single cell, extract the letter of the certain condition into another cell, and then extract that information into another table, all the while hiding all of the auxiliary columns in the original table. Because it would be much easier and prettier to simply type a bunch of letters into one box instead of having to check a bunch of boxes, no?
    For example Left Header Row 1 would contain the letters BMRT. Column A would return a "FALSE" value, while Column B would return "B" or "TRUE." Columns C through L return "FALSE," etc.
    In Left Header Row 2 we would have the string AJQTVZ, for instance. Column A would return "A" (or "TRUE"), and Columns B through I would return "FALSE."
    Is it possible to write such a formula? Or is there an easier way to be thinking about this problem?

    Let's start with the easy part.
    Cells on a Numbers table can contain data entered directly, or can contain a formula. They can't contain both. That means you cannot 'type the conditions into a single cell' in column A ("the left header" cell) AND have a formula which sets that cell to TRUE if the typed in data contains an "A".
    There's no problem doing this using column A as the key holder and columns B:Z to hold the TRUE/FALSE results, staring in both cases on row 2.
    Here's an example
    The column header cells (row 1) contain the letter corresponding to that column.
    The row header cells (starting at row 2) contain the 'bunch of letters' you describe. Note (A4) that the letters do not have to be entered in any particular order, and that extraneous characters (eg. a space) are ignored.
    The formula shown is entered B2, and filled down and right from there.
    =IFERROR(FIND(B$1,$A2)>0,FALSE)
    FIND returns the position of the first occurrence of the target string (in this case, the single letter at the top of the column) in the search string, then compares that with the value zero. For any letter that is included in the search string, the find value will be at least 1, so the comparison will return TRUE. If the target letter is not found, FIND returns an error. IFERROR traps this and returns FALSE.
    Since the target depends on the letter at the top of the column, all that's needed to extend the range of possible letters to the full alphabet is to enter an A in cell B1, then run through the alphabet A to Z, with Z in cell AA1.
    Depending what you want to do with the TRUE or FALSE values in these 26 columns, it may be possible to skip the auxiliary column step and use a formula similar to the one above as the condition argument of an IF(condition,do-if-true,do-if-false) statement.
    Regards,
    Barry

  • TS3988 computer associated with another apple id

    message says when i try to log into itunes match that it is associated with another apple id and cant log in for 65 days, how do i fix this ?

    Hi balbri,
    If you have questions about Apple ID associations, you may find the following article helpful:
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    Regards,
    - Brenden

  • FindChangebyList with strings of text?

    I'm trying to setup a findchangebylist document to change strings of text to match my company's verbiage. I've been successful changing items like:  $10.00 to read as $10 but I cannot get regular text like:  over-sized to read as oversized
    More examples of text I'm trying to convert:
    over-sized to oversized
    CAT to CAT(R)   (adding the registration mark)
    screenprint to screen print
    Is this possible with this script?? There's over 100 words that follow this mindset. The custom dictionary isn't something that works, as it only checks for single words and not 2 words with a space inbetween.
    Anything would be helpful.
    Thanks!

    Hi Trevor:
    I have to admit, I like your script (The syntax for the arrays is pretty clean, esp. with the tags) but we don't need to completely reinvent the wheel, and we have a lot of functionality within the FindChangeReplace script that wouldn't need too many more additions.
    nukleas wrote:
     There is the conflict of case sensitivity and some words you don't want to close up. A good example of this is in official titles (So you don't want to close up Over-All Program Goals 2012, but you are fine closing up over-all goals or over-stated nature.
    By adding a tag at the begining of words one wants to be stictly case sensertive one can deal with this
    By useing slice and toUpperCase() one can make sure that over-sized becomes oversized and Over-sized becomes Oversized.
    In the case that one only wants the upper case to be changed that would not need tagging i.e. in our example only CAT would become CAT®, cat would stay the same.
    To avoid Over-All being closed one also would not need to tag it because of the capitol A of All.
    One would only need to tag something like Over-all if one did not want it to become Overall but wanted over-all to become overall.
    True, but why don't we just add this to FindChangeReplace:
    grep     {findWhat:"(Over|over)-(?!\\u|\\d)(\\S*)"}     {changeTo:"$1$2"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    This way we don't need to write any more javascript code, and we preserve the features from that script, especially the option to do the search on individual stories or selections rather than the whole document, which is default for the script (I see these things usually from an inCopy standpoint, where you are working closely with the text) Having an easily editable text document as a list of things is probably not a bad idea either.
    We also catch any hyphenations of digits (which we ought to keep hyphenated) or uppercase letters and keep whatever formatting existed previously with a single entry.
    nukleas wrote:
    Also, if whole word is turned on in the given regular text search example, over-size will not be converted to oversize. over-sized would be converted to oversize.
    True, over-size would not be converted to oversize unless over-size was included in the word list.
    False, over-sized would be converted to oversized and not oversize
    Check the spelling in the script >.> (Yes, this is kinda pedantic, I apologize)
    nukleas wrote:
    This is also a concern copy editors have with closing up schoolteacher. In most cases it's fine, until you have a teacher that works at a high school. A high school teacher should probably not be written as high schoolteacher (although I'm sure some of them need to be to deal with some of today's youth.) and that's only really avoidable with a negative lookbehind.
    This can easily be dealt with by adding in the array after the entry of ' school teacher'  , 'schoolteacher'
    'high schoolteacher' , 'high school teacher'
    see script below
    Or in one line:
    grep {findWhat:"(?<![high|elementary|middle] )([S|s]chool) (teacher)"} {changeTo:"$1$2"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    Using the FindChangeReplace, we basically configure the text or grep search each time, so if we want, we can have something like this:
    Makes million/billion/trillion units not break over lines:
    grep     {findWhat:"(\\d+) (mil|bil|tril)(?=lion)"}     {changeTo:"$0",noBreak:true}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    This way we don't need to set about defining tags, since the way the script is written we can just call them when we need them.
    And in this case, wouldn't we be in trouble if the query we wanted has a semicolon or something at the beginning of it? This can be the case in changing delimiters and other things. By defining options outside of the query, we better sanitize the query from errant symbols.
    I think it might be best to also avoid changing things in the first place (like school teacher to schoolteacher and then backtrack with high schoolteacher to high school teacher) and the more exceptions or backtracks we need to make, the more likely errors will make it through.
    Then again, for some, if not most changes that need to be made without exceptions, regular text search is fine. However, there can be a lot more errors introduced without lookaheads or lookbehinds than it could be worth, and this is one of the things that keeps copy editors like me employed
    Also, with the script, why keep Pussy cat if it begins the sentence? The example would be perhaps the Pussy Cat Lounge, in that case you dont want to close that up or change that. However: Pussy cat is another term for a feline. Would not get changed, but it ought to. The script catches school teachers and high school teachers correctly, but not "School teachers are important to our nation" and (correctly) School Teacher's Association. These may need different capitalized versions of each type, or would possibly be better with grep and just brackets with both types alone. Case insensitivity in the grep can also preserve the capitalization of the original text, whereas I believe the text replace would change it to whatever the result is that is provided.
    grep     {findWhat:"([pP]ussy) (cat)"}     {changeTo:"$1"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    (and the problem with this, that I would have to get to later, is that the plurals need to be dealt with)
    All in all, I don't think it truly matters whether one uses GREP or text for such changes (it's actually best to know both!) and I appreciate you laying out how to perform these searches using javascript, I have definitely learned from it!
    I apologize for any errors, I typed this quite fast D:
    Many thanks Trevor,
    Nukleas

  • Stepping through a query result set, replacing one string with another.

    I want to write a function that replaces the occurance of a string with another different string.  I need it to be a CF fuction that is callable from another CF function.  I want to "hand" this function an SQL statement (a string) like this:   (Please note, don't bother commenting that "there are eaiser ways to write this SQL..., I've made this simple example to get to the point where I need help.  I have to use a "sub_optimal" SQL syntax just to demonstrate the situation)
    Here is the string I want to pass to the function:
    SELECT
      [VERYLONGTABLENAME].FIRST_NAME,
      [VERYLONGTABLENAME].LAST_NAME,
      [VERYLONGTABLENAME].ADDRESSS
    FROM
      LONGTABLENAME [VERYLONGTABLENAME]
    Here is the contents of the ABRV table:
    TBL_NM,  ABRV    <!--- Header row--->
    VERYLONGTABLENAME, VLTN
    SOMEWHATLONGTALBENAME, SLTN
    MYTABLENAME, MTN
    ATABLENAME, ATN
    The function will return the original string, but with the abreviations in place of the long table names, example:
    SELECT
      VLTN.FIRST_NAME,
      VLTN.LAST_NAME,
      VLTN.ADDRESSS
    FROM
      LONGTABLENAME VLTN
    Notice that only the table names surrounded by brackets and that match a value in the ABRV table have been replaced.  The LONGTABLENAME immediately following the FROM is left as is.
    Now, here is my dum amatuer attempt at writing said function:  Please look at the comment lines for where I need help.
          <cffunction name="AbrvTblNms" output="false" access="remote" returntype="string" >
            <cfargument name="txt" type="string" required="true" />
            <cfset var qAbrvs="">  <!--- variable to hold the query results --->
            <cfset var output_str="#txt#">  <!--- I'm creating a local variable so I can manipulate the data handed in by the TXT parameter.  Is this necessary or can I just use the txt parameter? --->
            <cfquery name="qAbrvs" datasource="cfBAA_odbc" result="rsltAbrvs">
                SELECT TBL_NM, ABRV FROM BAA_TBL_ABRV ORDER BY 1
            </cfquery>
         <!--- I'm assuming that at this point the query has run and there are records in the result set --->
        <cfloop index="idx_str" list="#qAbrvs#">      <!--- Is this correct?  I think not. --->
        <cfset output_str = Replace(output_str, "#idx_str#", )  <!--- Is this correct?  I think not. --->
        </cfloop>               <!--- What am I looping on?  What is the index? How do I do the string replacement? --->
            <!--- The chunck below is a parital listing from my Delphi Object Pascal function that does the same thing
                   I need to know how to write this part in CF9
          while not Eof do
            begin
              s := StringReplace(s, '[' +FieldByName('TBL_NM').AsString + ']', FieldByName('ABRV').AsString, [rfReplaceAll]);
              Next;
            end;
            --->
        <cfreturn output_txt>
        </cffunction>
    I'm mainly struggling with syntax here.  I know what I want to happen, I know how to make it happen in another programming language, just not CF9.  Thanks for any help you can provide.

    RedOctober57 wrote:...
    Thanks for any help you can provide.
    One:
    <cfset var output_str="#txt#">  <!--- I'm creating a local
    variable so I can manipulate the data handed in by the TXT parameter.
    Is this necessary or can I just use the txt parameter? --->
    No you do not need to create a local variable that is a copy of the arguments variable as the arguments scope is already local to the function, but you do not properly reference the arguments scope, so you leave yourself open to using a 'txt' variable in another scope.  Thus the better practice would be to reference "arguments.txt" where you need to.
    Two:
    I know what I want to happen, I know how to make it happen in another programming language, just not CF9.
    Then a better start would be to descirbe what you want to happen and give a simple example in the other programming language.  Most of us are muti-lingual and can parse out clear and clean code in just about any syntax.
    Three:
    <cfloop index="idx_str" list="#qAbrvs#">      <!--- Is this correct?  I think not. --->
    I think you want to be looping over your "qAbrvs" record set returned by your earlier query, maybe.
    <cfloop query="qAbrvs">
    Four:
    <cfset output_str = Replace(output_str, "#idx_str#", )  <!--- Is this correct?  I think not. --->
    Continuing on that assumption I would guess you want to replace each instance of the long string with the short string form that record set.
    <cfset output_str = Replace(output_str,qAbrs.TBLNM,qAbrs.ABRV,"ALL")>
    Five:
    </cfloop>               <!--- What am I looping on?  What is the index? How do I do the string replacement? --->
    If this is true, then you are looping over the record set of tablenames and abreviations that you want to replace in the string.

  • How to replace a particular striing with another string in jtextpane

    how to get replace a particular string with another string of a jtextpane without taking the text in a variable using getText() method .

    Thanks for your answer,
    "relevant object" means for you datasources, transfer rules and transformations ?
    With the grouping option "Save for system copy" I can't take easily all datasources, and others objects
    Will I have to pick all object one by one ?
    What would be the adjustement in table RSLOGSYSMAP ? For the moment it's empty.
    Regards
    Guillaume P.

  • Replacing a special character in a string with another string

    Hi
    I need to replace a special character in a string with another string.
    Say there is a string -  "abc's def's are alphabets"
    and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
    "abc&apos&s def&apos&s are alphabets" .
    Kindly let me know how this requirement can be met.
    Regards
    Sukumari

    REPLACE
    Syntax Forms
    Pattern-based replacement
    1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
    pattern
              IN [section_of] dobj WITH new
              [IN {BYTE|CHARACTER} MODE]
              [{RESPECTING|IGNORING} CASE]
              [REPLACEMENT COUNT rcnt]
              { {[REPLACEMENT OFFSET roff]
                 [REPLACEMENT LENGTH rlen]}
              | [RESULTS result_tab|result_wa] }.
    Position-based replacement
    2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
                      [IN {BYTE|CHARACTER} MODE].
    Effect
    This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
    When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
    In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
    System fields
    sy-subrc Meaning
    0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
    2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
    4 The subsequence in sub_string was not found in dobj in the pattern-based search.
    8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
    Note
    These forms of the statement REPLACE replace the following obsolete form:
    REPLACE sub_string WITH
    Syntax
    REPLACE sub_string WITH new INTO dobj
            [IN {BYTE|CHARACTER} MODE]
            [LENGTH len].
    Extras:
    1. ... IN {BYTE|CHARACTER} MODE
    2. ... LENGTH len
    Effect
    This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
    The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
    During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
    System Fields
    sy-subrc Meaning
    0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
    4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
    Note
    This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
    Addition 1
    ... IN {BYTE|CHARACTER} MODE
    Effect
    The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
    Addition 2
    ... LENGTH len
    Effect
    If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
    If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
    Example
    After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
    DATA:   text1      TYPE string       VALUE 'I know you know',
            text2(18)  TYPE c LENGTH 18  VALUE 'I know you know',
            sub_string TYPE string       VALUE 'know',
            new        TYPE string       VALUE 'should know that'.
    REPLACE sub_string WITH new INTO text1.
    REPLACE sub_string WITH new INTO text2.

  • Search given string array and replace with another string array using Regex

    Hi All,
    I want to search the given string array and replace with another string array using regex in java
    for example,
    String news = "If you wish to search for any of these characters, they must be preceded by the character to be interpreted"
    String fromValue[] = {"you", "search", "for", "any"}
    String toValue[] = {"me", "dont search", "never", "trip"}
    so the string "you" needs to be converted to "me" i.e you --> me. Similarly
    you --> me
    search --> don't search
    for --> never
    any --> trip
    I want a SINGLE Regular Expression with search and replaces and returns a SINGLE String after replacing all.
    I don't like to iterate one by one and applying regex for each from and to value. Instead i want to iterate the array and form a SINGLE Regulare expression and use to replace the contents of the Entire String.
    One Single regular expression which matches the pattern and solve the issue.
    the output should be as:
    If me wish to don't search never trip etc...,
    Please help me to resolve this.
    Thanks In Advance,
    Kathir

    As stated, no, it can't be done. But that doesn't mean you have to make a separate pass over the input for each word you want to replace. You can employ a regex that matches any word, then use the lower-level Matcher methods to replace the word or not depending on what was matched. Here's an example: import java.util.*;
    import java.util.regex.*;
    public class Test
      static final List<String> oldWords =
          Arrays.asList("you", "search", "for", "any");
      static final List<String> newWords =
          Arrays.asList("me", "dont search", "never", "trip");
      public static void main(String[] args) throws Exception
        String str = "If you wish to search for any of these characters, "
            + "they must be preceded by the character to be interpreted";
        System.out.println(doReplace(str));
      public static String doReplace(String str)
        Pattern p = Pattern.compile("\\b\\w+\\b");
        Matcher m = p.matcher(str);
        StringBuffer sb = new StringBuffer();
        while (m.find())
          int pos = oldWords.indexOf(m.group());
          if (pos > -1)
            m.appendReplacement(sb, "");
            sb.append(newWords.get(pos));
        m.appendTail(sb);
        return sb.toString();
    } This is just a demonstration of the technique; a real-world solution would require a more complicated regex, and I would probably use a Map instead of the two Lists (or arrays).

  • Hi I've a big problem with adobe acrobat reader XI pro and I hope you can help me. The problem is; when I past copied text from some pdf books (not all of them) it past symbols only! wherever I past it! and even if I coped that text from another pdf reade

    Hi
    I've a big problem with adobe acrobat reader XI pro and I hope you can help me.
    The problem is; when I past copied text from some pdf books (not all of them) it past symbols only! wherever I past it! and even if I coped that text from another pdf reader (adobe pdf reader, internet browsers, ...etc.).
    This problem started to happen since yesterday when I installed adobe acrobat reader XI pro to try it before I buy it, and before that when I was using the free adobe pdf reader I was totally able to copy any text from any pdf and past it anywhere with nothing wrong.
    What can I do?
    thank you a lot.

    There is no product called Adobe Acrobat Reader Pro. There is
    - Adobe Acrobat Pro ($$)
    - Adobe Reader (free)
    Which do you have? And are you a programmer?

  • How can I substitute a string with another string in a file

    I have a file. I have a substitute a keyword with another string in all the occurences of a file. How can I do this?

    I'm gonna give you the benifit of the doubt and assume you didn't mean to double post your question.
    As to substitute a keyword with a string one way is to read in the file and run it through a StreamTokenizer class to break it into words. Pull one word at a time, check it, and stick it into a StringBuffer. Once your done with the file overwrite it with what is in the StringBuffer.
    Another way might be to use the RandomAccessFile class, but I'm not really familiar with that because I hardly ever use it.

  • Replace a string with another string in a file

    I have to replace a string with another string. Say for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived path like
    "c;\\sample folder\\sample subfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the file.

    I have to replace a string with another string. Say
    for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived
    path like
    "c;\\sample folder\\samplesubfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the
    file.
    public class Buckel {
      final static String CONST = "c:\\sample folder\\samplesubfolder\\samplefile.html";
      public Buckel() {
      public static void main ( String[] argv )  throws Exception {
        int    idx = 0;
        String in  = "<a href=\"##\"></a>",   // We'll imagine this just gets here somehow. If it's on the i/p file then take the '\' out B4 and aft the '##'.
               out = "";
        idx = in.indexOf( "##" );
        if ( idx > 0 ) {
          out = in.substring( 0, idx ) + CONST + in.substring( idx+=2, in.length() );
        System.out.println( out );
    }

  • HT3529 Am I correct in assuming that if I iMessage with another iphone user while we are both in a foreign country, I will not incur texting charges?

    Am I correct in assuming that if I iMessage with another iphone user while in a foreign country that I will not incur texting charges?

    Correct.

Maybe you are looking for

  • How do I fix my unbalanced body error?

    Hi, I am new to dreamweaver cs6 and I DESPERATELY need help! Every I go to save a template or create a new page from the template, I get an error message saying.... There is an error at line 149 "***": unbalanced body tag. I've been through several f

  • MBP startup issue

    Hello, I was wondering if anyone else has run into this or may have some insight. On two separate occasions I've tried powering on my MBP and after hitting the power button it would come on, I could hear the hard drive spinning up, but then it would

  • HT202659 what is my password for icloud?

    hey my name is Ruffin what is my password for icloud? <Personal Information Edited by Host>

  • Error installing.. here is the log

    im installing oracle 9.2.0.4 on SUSE 10.1 for study purposes, im almost there when the oracle installer stops at 85%.. Error from $HOME/oraInventory/logs/oraInstall##### java.lang.ExceptionInInitializerError: java.util.MissingResourceException: Can't

  • Use iTunes library file from old account

    Earlier: Lion on Macbook Pro, one SSD drive for system and one for media. Moved iTunes library to the Media drive, and told iTunes, worked like a charm. Now, after having formated the system disc and reinstalled system (Mountain Lion), I replaced the