Find and replace m2 and m3 to subscripts

Now I change m2 and m3 to what on the clipboard.  But that doesn't work when I have m2 and m3 in different colors and different fonts tru the lay-outs. 
How can I find and replace m2 and m3 to m subscript 2 and m subscript 3?
Only m2  not 2 alone.
Many thanks

Your "Only m2 not 2 alone" seems to contradict what you wrote earlier, but I guess that what you want is to style 2 and 3 only when they are preceded by m. If that's the case, do this in the grep tab of the Find/Change dialog:
Find what: (?<=m)[23]
Change to: <leave empty>
Change format: select subscript.
(?<=. . .) is a so-called lookbehind, [. . .] a character class. (?<=m) means 'preceded by' and [23] stands for '2 or 3'.
Peter

Similar Messages

  • 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.

  • When I use Preview,Photo Mechanic and Pages, all JPEG or RAW images appear corrupted. I thought my hard drive was failing and replaced it and migrated everything over but the problem still exists. Any idea what is going on?

    When I use Preview,Photo Mechanic and Pages, all JPEG or RAW images appear corrupted.
    I thought my hard drive was failing and replaced it and migrated everything over but the problem still exists.
    It felt as if maybe a virus was at work but I ran Sophos and found nothing.
    I store images on my Drobo Raid system but when I work from my Macbook Pro I have no issues, just on the tower.
    Any idea what is going on?

    First of all, why did you say yes to Nero Back up before researching what it does with files already on the HDD? When I install Nero, the Back Up is the first thing I disable, it is a nagging pain, there are much better backup programs available. There are several file recovery programs out there to recover deleted files, that is, if that is what happened. Also, if you haven't overwritten the files, so you should be able to find them.

  • Taking out and replacing memory and hard drive.

    Hey so I want to get a macbook pro 13 in. and I want to upgrade it by putting in more memory and a better hard drive, but I want to buy parts from a different site because it is so much cheaper. Is it easy to take out and replace the memory and hard drive of a macbook pro?

    Just make sure the RAM you're buying is brand name and match the specs of your macbook.
    Getting cheaper RAM modules sometimes cause issues with the way your Macbook peforms.  Learned that lesson when I decided to buy Kingston Value RAM.  Had nothing but trouble.
    Stick with brands like Crucial ( which I use ), Corsair, Mushkin, Kingston (non value) and from OWC.
    As for the hard drive, stay away from Western Digital Blue edition, some macbooks have issues with them.
    Also make sure you buy an external USB enclosure so you can clone your drive before you intall it and install your old drive in the USB enclosure and use it as your backup drive.
    If you're technically capable, it quite easy swapping out the RAM and Hard Drive.
    Do the clone first before you do anything else.  That way, when you're done the clone, you just have to open up your macbook once to do the swap.
    Good luck and hope everything goes smoothly for you.
    Post back if you need a hand or have any questions.

  • Find and Replace text and change font help needed.

    I am completely new to Scripting and I'm sure this is quite simple but I do not know where to start.
    I have a FM template that is populated with "raw" text from a database.
    Within the text are several characters (+, @, *, $, # and %).
    I need to replace these characters with symbols from a different font e.g.:
    Each instance of:
    "+" to be replaced with Wingdings 2 font - Lowercase t
    "@" to be replaced with Wingdings 2 font - Lowercase u
    "*"  to be replaced with Wingdings font - Uppercase E   etc.
    I would like to automate the process and believe a script would enable me to do this.
    I have tried looking on the forum, but can not find anything suitable to help me (or I'm looking in the wrong place).
    Any help would be greatly appreciated.
    Cheers
    Kev

    not really
    important is the Illustrator Text Object-model, which is not very easy to understand.
    And the Core JS String and regExp Objekts.
    Have a look at this:
    http://www.ogebab.de/home/skripte/text/replace
    The dialog is poor (because of compatibility) and it works simply on TextFrames.contents, i don't know if this is good i all cases.
    But i use it not very often so i don't want to rewrite it.
    Maybe it is a starting-point for you.
    But maybe it is more then you need.
    try this:
    //select a text
    var text = app.activeDocument.selection[0];
    var string = text.contents;
    string = string.replace(/ /g,"  ");
    text.contents= string;
    / /g is a regular expression
    .replace() is a method of the String Object
    both explained at
    https://developer.mozilla.org/en/JavaScript/Reference

  • Find and Replace - projects and / or activities

    Our users really like the template maintenance find / replace functionality. Is there a way to do something similar with Projects / Activities within those elements that are currently active projects? Thx

    Thanks for giving us feedback on NPD template mantenance functionality. Unfortunately, we haven't got the similar functionality around projects/ activities. However, You can use temporary signature authority (TSA) in NPD to grant someone the privilege to act on your behalf for a period of time. This means that a designated user (authority grantee) can approve or disapprove signature requests and manage activity workflow on behalf of you (authority grantor). please refer to 'Agile Product Lifecycle Management for Process New Product Development User Guide' for more details.
    If this functionality can't meet your requirement, Please submit an enhancement request so we can notify you when this feature is available in future release. Thank you!

  • GREP search and replace: numbers and commas

    I have a list of numbers 1000, 15000, 250500, etc. and I would like to find only numbers that have 5 or more digitals, and insert a comma, like the following:
    1000 no change
    15000 replace with 15,000
    250500 replace with 250,500
    TIA

    One note, the replace patterns in ID need to use $, so that would be $1,$2 - otherwise I think that will work fine.
    You can also use curly brackets to indicate the number of possible occurrences of a pattern you're looking for.
    (\s\d{1,3})(\d{3}\s)
    Means find a space, 1 to 3 digits followed by 3 more digits and another space.
    One little note, if you were to put a bunch of number separated by single spaces in a string, this would skip alternate ones, because the trailing space of one number would be considered part of the find pattern for that match, and so would not be available as the leading space of the next number. (That may be very badly phrased, sorry.) In that case I think you'd have to break those spaces out to lookaheads/lookbehinds, where you include them in the find logic without making them part of the matched string. (Which may have made this response even less intelligible, but are at least terms to look at in the documentation.)

  • If I buy a mac nook air in USA and use it in india or some other country will I get the same service and replacement facility and buy the apple protection plan in some other country?

    Will I be able to use the same services in other country?
    Will I be able to book the apple protection plan in other country?
    If at all I get a replacement for my mac book air, then will I have to send it to the country from where I bought or anywhere?

    It looks as though the Mac has a global warranty.  Take a look at Applecare Protection Plan for Mac or Apple Display for full details.
    It likely depends on the availability of Apple stores or authorised repair agencies in the country you will be in.

  • Find and replace Dreamweaver mx 2004 problem: not opening saved queries

    Dreamweaver mx 2004 is not opening saved queries! I use find and replace often and uses to save code replacements to reuse
    it. But now when I open the saved query I have 2 situations:
    1) comes completely blank
    2) or only shows truncated text or code in fields.
    I opened the dwr file in text editor and seems to be fine, I mean information saved is there.
    Tried recreating cache, or deleting caché, tried saving new or overwritting existant ones, tried saving into a completely different location,
    tried in other site definition. Nothing seems to work...

    Which FTP app did your predecessor use to upload files?  If it's still on your work station, it should contain the log-in credentials.
    You'll find a few utilities online for revealing passwords
    http://www.rixler.com/?gclid=CJeUxd775LkCFWZk7AodyiAAaQ
    Nancy O.

  • Find and Replace using Behaviors

    I used Find and Replace in CS3 to add HTML code that includes
    a DW Behavior. The behavior opens a message popup when clicked.
    The Find and Replace works and by adding the Behavior code
    correctly. However, when I save the page and then click the link to
    test the behavior, the popup does not appear.
    The only way I can get the Behavior to work correctly is to
    complete the Find and Replace, double-click to open the Behavior
    from the Tag group, close the behavior and then resave the page.
    Is this a DW problem or am I doing something wrong?

    You are probably not adding all the necessary code during the
    search and
    replace. What exactly are you pasting in?
    Alec
    Adobe Community Expert

  • Search and Replace String throwing the wrong error message with regexp?

    This came up in a LAVA thread, and I'm not sure if there's a bug here or not. When using Search and Replace string, and using a regular expression of [(G[b|i])], LabVIEW throws error -4622, "There is an unmatched parenthesis in a regular expression."  There are obviously no unmatched parenthesis in that expression, so it seems to me that the wrong error is being thrown. I'm just not sure if that's a syntactically valid regexp. The problem seems to be with nesting [ ]'s inside ( )'s inside [ ]'s. I've tried a couple of regexp resources on the Web, and one suggests it's valid, while the other seems to think it isn't.
    Message Edited by eaolson on 03-13-2007 10:33 AM
    Attachments:
    ATML_StandardUnit2.vi ‏10 KB
    regexp.png ‏5 KB

    adambrewster wrote:
    I think your regexp is invalid.
    In regexps, brackets are not the same as parentheses.  Parens are for grouping, while brackets are for matching one of a class of characters.  Brackets can not be nested.
    If the regexp is replaced with [G[bi]], there is no error, so it's not a matter of nested brackets. I couldn't find anything on the PCRE man page that forbids nested brackets specifically, but it makes sense.
    Your expression "[(G[bi])]", therefore parses as a character class which matches '(', 'G', '[', 'b', or 'i' followed by an unmatched paren, and an unmatched bracket.
    I don't believe that's the case. Replace the regexp with [(Gbi)], and the error goes away. So it's not a matter of the '(' being literal, and then encountering a ')' without a matching '('.
    daveTW wrote:
    what string exactly you want to replace? I think the round braces are not right in this case, since they mark partial matches which are given back by "match regular expression". But you don't want to extract parts of the string, you want to replace them (or delete, with empty <replace string>). So if you leave the outer [( ... )] then your RegEx means all strings with either "Gb" or "Gi".
    It's not my regular expression. A poster at LAVA was having problems with one of his (a truly frightening one), and this seemed to be the element that was causing the problem. I'm pretty sure that the originator of the regexp meant to use G(b|i), which seems like a complicated way of matching "Gb" or "Gi", if you ask me.

  • Can I do search and replace in a batch?

    Hi, Everyone:
    Years ago before I start useing Indesign, I had a Chinese Desktop Prepress program named Westwinner, With tahat I could create a file putting all entries  needed to search and replace in, and search and replace all of them in one shot. Now I wonder if I can do the same with Indesign CS4.
    For your reference, the file for batch search I used in Westwinner looks like that:
    x@x'
    y@y'
    z@z'
    etc.
    Thanks for everyone that reply!

    I meant that scripts can be edited in a plain text editor like Notepad on Windows or the equivalnet on Mac. You still need to understand the scripting language. That script should be availble in AppleScript, VBScript (which work only on Mac or Windows, repectively) or JavaScript, which is cross-platform.
    You don't actually need to edit the script itself very much, I suspect, if at all. In the Javascript version (I'm looking at that in the ESTK) on line 116 you'll see: var myFindChangeFile = myFindFile("/FindChangeSupport/FindChangeList.txt")
    This line is telling the script to find the file FindChangeList.txt in the FindChangeSupport folder which shoujld be inthe same folder as the the script itself. All of the instructions for want to find and how to change it are in that text file, which is a tab-delimited file with each find/change operation on a single line. The stucture of that file is described in the comments section above the script code, so you should be able to design a new file to do what you need to do, then change that single line defining the variable to find the new text file and save the script. If you replace the existing FindChangeList.txt with your own file you wouldn't even need to edit the variable, but the script as written is so useful I wouldn want to give it up, so I'd make a new text file, edit the variable, and save the script with a new name for your own searches.
    I'm not really a script writer, myself. I read javascript fairly well so I was able to see how this script works, but if you need more help you probably should move over to the scripting forum and talk to the real experts.

  • Read a spreadsheet and replace spaces

    I am using a cfspreadsheet tag to read excel file. Since, I am using QoQ, the file import errors out since the header row has spaces in it?
    How do we read the header row specifically and replace spaces and save the file before moving forward? Thanks
    <cfspreadsheet action="read" src="c:\WellRecords.xls" query="qryRecords" headerrow="1" sheetname="1">

    I am using a cfspreadsheet tag to read excel file. Since, I am using QoQ, the file import errors out since the header row has spaces in it?
    How do we read the header row specifically and replace spaces and save the file before moving forward? Thanks
    <cfspreadsheet action="read" src="c:\WellRecords.xls" query="qryRecords" headerrow="1" sheetname="1">

  • I have tried suggestions found on this website from other Ipod Classic users without success. I cannot get my Ipod Classic to sync any more - have tried on 3 computers with different OS's. Apple have tested Ipod and its lead and pronounced it OK.

    This is the third time of writing this on your Apple Support Communities!  My Ipod Classic will not sync.  I have had it checked over at an Apple Genius Bar and also its lead - they say it is OK.   I have had my computer checked at the place that built it for me (Windows 7 desktop when I found Windows 8 childish and irritating).  After collecting it, I again had the Ipod symbol back on my library page, which was a step forward.  However, the Ipod still won't sync.
    I have tried other USB ports.  I have tried removing Itunes from computer and downloading it again - with the latest version of course.  I have tried authorising my computer.   I have tried resetting the Ipod.  I have tried ringing the Apple helpline at vast expense - the first assistant was helpful and went through a number of procedures before suggesting I removed and replaced Itunes and then rang back after doing this.  I was given a reference number to quote so that I wouldn't need to go through the whole rigmarole again with another assistant.  But, unfortunately, I got an extremely offensive young man who more or less called me a liar when I quoted the job number I had been given.  He flatly refused to accept that I had already spent ages on the phone that afternoon and said that my last call to Apple, to which the reference number referred, had been in November 2011.  When I asked to speak to a manager, he put the phone down for ages and left me paying for minutes, just waiting.  I put the phone down eventually and rang back, got this person again, and again asked to speak to a manager, whereupon the phone was put down on me.  Needless to say, I am not keen to try this phone service again in a hurry.  But I do desperately want to be able to download my Economist in audio podcasts, which I have been without for a whole month now.  Please can someone knowledgeable take pity and help me?  By the way, what does IOS mean? (I thought IO stood for operating system, but am flummoxed by the S on the end.  I have a newly built computer using Windows 7, the latest updated version.

    chicx wrote:
    This is the third time of writing this on your Apple Support Communities!
    Not with your current user id.
    Far too much uneccesary information in your post, which only confuses things, a vast amount!
    Let's start with iTunes.
    Have you updated iTunes to 11.1.5, because the previous version did appear to have an issue about seeing iPods?
    With iTunes 11.1.5 installed, look in Edit/Preferences/Devices, (or use the ALT key, followed by the E key and then the F key) and make sure that the box named Prevent iPods, iPhones and iPads from syncing automatically does not have a tick in the box.
    Once you have doen those two things, check to see if the iPod is seen by iTunes.
    chicx wrote:
    By the way, what does IOS mean? (I thought IO stood for operating system, but am flummoxed by the S on the end.
    Really?
    OS stands for Operating System. (In computer speak, IO means Input/Output.)
    iOS originally stood for iPhone Operating System, but it now refers to the iPod Touch and iPhone. The iPod Classic, which you have listed in your profile as your iPod, does not use iOS.
    I assume that you have been listening to the Podcast in your iTunes on the computer as you cannot transfer it to your iPod. It's what I'd do.

  • Find and Replace Subscript

    Hi,
    I am trying to figure out how to find and replace subscripted characters, e.g. H2O (with the "2" subscripted). How is this done?

    Yeah, it has two options. Use formatting (e.g., subscript, but also font, weight, size, leading, colour and whatnot) or do not use formatting -- which does not help, as it is the same as your search string ...
    But fear not. If your "H2O" is the only one, you can do this -- what Peter meant with his two-step.
    1. Search for "H2O" and replace it with "H[ha!]O". Be sure to check both "whole word" and "case sensitive" icons below the replace field. Every "2"
    i inside
    a text "H2O" will be replaced by something unique -- that's what the "[ha!]" should be.
    2. Replace "[ha!]" with "2".
    i Uncheck
    "whole word" and "case sensitive" (because elsewise it won't find anything), and in the Replace Formatting field, select "Subscript" in the Type panel. This 2nd time, you are only replacing the unique string that was put into its unique position in the previous step.
    A 2nd option (one that I don't recommend to freshmen!) is to use the GREP Find-and-replace. This is, in the right hands, an extremely powerful tool, which can
    i search
    for "H2O" and
    i change
    just the "2" part. If I only knew how, off the top of my mind! But, it's neither an easy to remember shortcut, nor perfectly logical, and the 2-step method is.

Maybe you are looking for