WildCard Find & Replace Question

Hey, Forum;
I've just inherited a site with over 800 image tags, none of which have any Alt attributes, not even empty ones. I want to start fixing the problem by doing a find and replace on all image tags, dropping an empty alt="" after each image path. All image paths being different, I'd start with this (Find):
<img src="[^"]*"
with the intention of replacing all results with a space and alt="" after the existing string. Problem is, when I try it with this (Replace):
<img src="[^"]*" alt=""
the replacement string is literal... all img src= paths will be replaced with "[^"]*". The question is, is there a way to use a wildcard in the replace function that leaves the existing code in place?
Thanks much.
Cayce

Cayce,
Ctrl+F:
     Find in:     Current Document (to test)
     Seach:     Specific Tag:        img
     Action:     Set Attribute:          alt          To:  #
Replace All.
If this works as it should, you can Find in: Entire Local Site Folder but be sure to backup your site files first because you cannot undo this process.
Best of luck,
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media  Specialists 
http://alt-web.com/
http://twitter.com/altweb

Similar Messages

  • Copy alt text to title [Branched from: WildCard Find & Replace Question]

    Fabulous, so now I am able to add the code (alt=" ") to any image that does not already have one. Now is there a way to do a similar task AND have the replace function fill in the text based on existing info.?
    My situation is I have images with alt text AND now have to add title info. to the image (title=" ") that is a duplicate of the alt text.
    SO, is there a way to tell the system to find all alt text tags and replace them with alt text and title tag, where the title tag is a duplicate of the alt info.?
         FIND alt="*.*"
         REPLACE with alt="*.*" title="*.*"
    I tried *.* and that does not work.

    Ok, thank you for the reminder about how a screen reader reads things. I am passing that along to my cohorts. A piece of the puzzle that may help is our reasoning for adding the title tag to images is that in IE8 browser the alt text is not always popping up when a user scrolls over the image, and by placing the title tag into the code then the text entered for the title tag does pop up when user scrolls over the image. Is there another/better way to do this?
    FYI - So I tried the method you suggested and below is the original code AND then the resulting code. The results only added the info. entered in the replace box verbatim and didn’t copy the alt text and place it in the title tag. It even overwrote my existing alt text.:
    Original code –
    img alt="US 8 (WIS 35 - US 53) Corridor Preservation overview/location map" height="220" src="images/map-overview.gif" width="300"
    img alt="Map key - Thick orange line is the project overview/location, thin purple and green lines are project segments, and the blue tear drop with dot in center are the project boundaries." height="174" src="../../images/map-keymultiseg.gif" width="271"
    Resulting code –
    img alt="$1" height="220" src="images/map-overview.gif" title="$1" width="300"
    img alt="$1" height="174" src="../../images/map-keymultiseg.gif" title="$1" width="271"

  • Applying Bolds and Italics while doing a Find/Replace on Data Merged content

    Hi,
    Wonder if you kind knowledgeable folks can help me with a Find/Replace question.
    I am doing a data merge of a book contents into indesign, where my data merge file is a straightforward text csv file which is tab delimited. I have two (almost similar) things I would like to do to specific parts of the text but don't know how to achieve this. 
    -  Firstly, I would like to preserve words/sentences with an 'italic' form but this is obviously lost in a csv file.  Is there anyway I can mark these words in order that a find/replace can make this word italics.  Im hoping there is a solution which resembles something like this;
    eg.  Book content is "The Word Italic needs to be adjusted".
    Original content is amended to be "The Word $Italic$ needs to be adjusted", so that a dollar sign encapsulates the word to be made Italic.
    Then I am able to data merge the csv file and somehow do a find/replace of words/sentences which are encapsulated by the dollar sign.  Thus, doing a find/replace of all words/sentences which satisfy this condition and then apply italics to all words between the dollar signs.
    - My other issue is I am using the '|' character in my text to determine the paragraph seperators.  I then do a find/replace after importing the text to replace all instances of '|' to the paragraph seperator (a kind of $ symbol, a representative character from the pop-up menu to the right of the Change To box). This works fine, but I'd like to make the paragraph seperator to be a BOLD format so that it can distinguish better the seperating sections of text.
    But this is different from my 'italics' issue above since I am trying to apply a BOLD format to the 'Change to' character, rather than something which exists in my original csv.
    Hope I make sense but I'd be happy to provide screenshots etc (when I get home )
    Best Rgds
    L

    two solutions.
    for the italic solution, i'd say the OP answered his own question with one exception - don't use dollar symbols, instead use = or another character which isn't reserved by GREP.
    the solution i would use for italics would be a GREP search once the merge is complete. have a look at the picture to see what i've done.
    the second solution: GREP styles.
    this assumes that the text will have a paragraph style assigned to it. make a character style called BOLD and within that style, the only thing to change is within basic character formats, make the font style bold. could even make the character another colour such as cyan so it is more easily idenfiable.
    next, go to the paragraph style options, go to GREP styles and match the following screengrab
    the advantage with a GREP style is that once the pipe symbol (|) is replaced, its bold GREP style character formatting is lost; and it means less post processing and no need for a second search of the text - it's all live.

  • Find & replace part of a string in Numbers using do shell script in AppleScript

    Hello,
    I would like to set a search-pattern with a wildcard in Applescript to find - for example - the pattern 'Table 1::$*$4' for use in a 'Search & Replace script'
    The dollar signs '$' seem to be a bit of problem (refers to fixed values in Numbers & to variables in Shell ...)
    Could anyone hand me a solution to this problem?
    The end-goal - for now - would be to change the reference to a row-number in a lot of cells (number '4' in the pattern above should finally be replaced by 5, 6, 7, ...)
    Thx.

    Hi,
    Here's how to do that:
    try
        tell application "Numbers" to tell front document to tell active sheet
            tell (first table whose selection range's class is range)
                set sr to selection range
                set f to text returned of (display dialog "Find this in selected cells in Numbers " default answer "" with title "Find-Replace Step 1" buttons {"Cancel", "Next"})
                if f = "" then return
                set r to text returned of (display dialog "Replace '" & f & "' with " default answer f with title "Find-Replace Step 2")
                set {f, r} to my escapeForSED(f, r) -- escape some chars, create back reference for sed
                set tc to count cells of sr
                tell sr to repeat with i from 1 to tc
                    tell (cell i) to try
                        set oVal to formula
                        if oVal is not missing value then set value to (my find_replace(oVal, f, r))
                    end try
                end repeat
            end tell
        end tell
    on error number n
        if n = -128 then return
        display dialog "Did you select cells?" buttons {"cancel"} with title "Oops!"
    end try
    on find_replace(t, f, r)
        do shell script "/usr/bin/sed 's~" & f & "~" & r & "~g' <<< " & (quoted form of t)
    end find_replace
    on escapeForSED(f, r)
        set tid to text item delimiters
        set text item delimiters to "*" -- the wildcard 
        set tc1 to count (text items of f)
        set tc2 to count (text items of r)
        set text item delimiters to tid
        if (tc1 - tc2) < 0 then
            display alert "The number of wildcard in the replacement string must be equal or less than the number of wildcard in the search string."
            error -128
        end if
        -- escape search string, and create back reference for each wildcard (the wildcard is a dot in sed) --> \\(.\\)
        set f to do shell script "/usr/bin/sed -e 's/[]~$.^|[]/\\\\&/g;s/\\*/\\\\(.\\\\)/g' <<<" & quoted form of f
        -- escape the replacement string, Perl replace wildcard by two backslash and an incremented integer, to get  the back reference --> \\1 \\2
        return {f, (do shell script "/usr/bin/sed -e 's/[]~$.^|[]/\\\\&/g' | /usr/bin/perl -pe '$n=1;s/\\*/\"\\\\\" . $n++/ge'<<<" & (quoted form of r))}
    end escapeForSED
    For what you want to do, you must have the wildcard in the same position in both string. --> find "Table 1::$*$3", replace "Table 1::$*$4"
    Important, you can use no wildcard in both (the search string and the replacement string) or you can use any wildcard in the search string with no wildcard in the replacement string).
    But, the number of wildcard in the replacement string must be equal or less than the number of wildcard in the search string.

  • Find/Replace - multiple replace ... maybe with regex

    Hello Dreamweaver community ... I'm relatively new to using Dreamweaver as an editor and I'm working on a large migration project that I'm trying to make easier. Basically, I'm converting an entire site from English to Spanish ... almost literally tag by tag
    Something that would make my job a lot easier is if ... every time I open a new Spanish language content file I could ...
    replace ALL Spanish language grammar symbols, accents, tildes etc ... with their HTML equivalents ... for example ...
    á  = &aacute;
    é = &eacute;
    í = &iacute;
    And so on ... there's about 10-12 major changes ...
    What I need to figure out is how to save a find/replace query in Dreamweaver .dwr format that replaces all symbols at once instead of needing to do them one at a time ...
    Seems like this shoudl be possible but I haven't figured out the right syntax ... I used the (.+) and $1 but it only worked conditionally - in the order the replacements were written. I need it to find ALL instances of a spanish symbol and replace it with its corresponding html ...
    Can anyone help me with this ...?
    Thank you in advance ...

    This is in fact the only solution I found to this problem.
    Creating an extension is not that difficult once you have the right
    reference material.
    Have a look at:
    DW API function to find and replace
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_code_cd_013.html
    Sample extension file on your machine after installing DW
    C:\Program Files\Adobe\Adobe Extension
    Manager\Samples\Dreamweaver\
    Full specifications of the MXI (extension file) format
    http://download.macromedia.com/pub/exchange/mxi_file_format.pdf
    quote:
    Originally posted by:
    Newsgroup User
    > So, is it indeed possible to run more than one
    find/replace query at a
    > time?
    As far as i know, no it's not possible.
    There has been mentions in the past to this question that a
    series of
    find/replace queries could be built as a dw extension instead
    of a saved
    search query.
    Alan
    Adobe Community Expert, dreamweaver

  • Using Grep to find/replace

    I'm trying to find out how to use GREP in find/replace to chage the formatting of some text that comes in from a spreadsheet.
    I worked out the GREP query "~b(\d\d)~b", which finds a paragraph return, followed by two digits, followed by another paragraph return
    and then it is replaced by "\t $1~b", which is a tab, the two found digits and a para return.
    What i need to do is to amend the query to find ANY number of digits, (which may be comma delimited: eg 23, 36, 48 ,50), and then replace with a tab + found text.
    I suppose what I'm looking for is a way for the query to find "any text between two paragraph returns, no matter what tthe length", but I don't know how to do this.All the Wildcard options seem to find just one exampler (one digit, one character etc)

    And you came so far
    The operators for repeat are ? (zero or once), * (zero or more) and + (once or more). You can also specify exact numbers: {at least,up to}.
    All of these operators are "greedy" by default -- they will match as much as possible. To match as least as possible (which I'm sure you'll come up against, sooner or later), add another ? after the repeat expression.
    So this will find one digit, then optionally another (which will always be included):
    \d\d?
    and this one digit, then zero or as much as ten million million zillion:
    \d\d*
    which is functionally the same as
    \d+
    And this will find between 3 and 8 digits but will forced to use the shortest possible match:
    \d{3,8}?
    That said: A quick & dirty solution for your actual problem is to find any amount of digits, spaces, and comma's:
    ~b[\d, ]+~b
    (we need the plus here because otherwise it would also match an empty line). The [..] brackets an Inclusive list --- it will match any of the single codes inside.
    A more complicated but 'neater' way is to search very specifically only for number, comma, space, number sequences -- it's neater because that way malformed lines (comma without a space) will be skipped!
    (It also introduces another code -- the parentheses operators. Look them up in a good GREP reference --lost of people are enthousiastic about Peter Kahrel's O'Reilly title, because it's about using GREP in InDesign.)
    ~b\d+(, \d+)*~b

  • How to find & replace in Javascript code?

    Hi all!
    I hope that this turns out to be an easy question! We recently updated several forms (about 50 of them) to alter a select set of field names per customer requirements. However, it turns out that one of these fields is a key field and is referenced in one or more places by JavaScript within the PDF.
    In Acrobat 6 I'd select the option to edit all scripts which would give me a big document with all of the Javascript within the PDF. I could then do a find/replace on the code and save it. Now, using Acrobat Pro 9, I cannot find anything like this. Please don't tell me that I have to search through all of the different form fields and PDF objects to find all of the script pieces tied to objects or events! I'm really, really hoping that there is an easier way to do this since right now I'm out of ideas and really don't want to have to sift through all of the objects in over 50 PDF documents.
    Thanks in advance for pointing me in the right direction!

    Talk about not being able to see the forest for all the trees! I can't believe that I missed that -- I spent quite a while looking all over before posting. *sigh*
    The exact menu sequence (for those interested) is Advanced -> Document Processing -> Edit All JavaScripts...  That is exactly what I needed. Thanks!!!

  • How can I remove all content between two tags using Find/Replace regular expressions?

    This one is driving me bonkers...  I'm relatively new to regular expressions, but I'm trying to get Dreamweaver to remove all content between two tags in an XML document.  For example, let's say I have the following XML:
    <custom>
    <![CDATA[<p>Some text</p>
    <p>Some more text</p>]]>
    </custom>
    I'd like to do a Find/Replace that produces:
    <custom>
    </custom>
    In essence, I'd like to strip all of the content between two tags.  Ideally, I'd like to know how to strip the CDATA content as well, to return the following:
    <custom>
    <![CDATA[]]>
    </custom>
    I'd much appreciate any suggestions on accomplishing this.
    Many thanks!

    Thanks much for your response.  I found David's article to be a little thin with respect to examples using quantifiers in coordination with the wildcard metacharacters; however, I was able to cobble together a working expression through trial and error using the information he presented.  For posterity, here’s the solution:
    Find:
    <custom>[\d\D]*?</custom>
    Replace:
    <custom>
    <![CDATA[]]>
    </custom>
    I believe this literally translates to:
    [] = find anything in this range/character class
    \d = find any digit character (i.e. any number)
    \D = find any non-digit character (i.e. anything except numbers)
    *? = match zero or more times, but as few times as possible (i.e. match multiple characters per instance, but only match one instance at a time, or none at all)
    I’m still not sure how to effectively utilize the . wildcard.  For example, the following expression will not find content that ends with a number:
    <custom>.*?[\D]*?</ custom >
    I'm presuming this is because numbers aren't included in the \D metacharacter; however, shouldn't numbers be picked up by the .*? expression?

  • Find / replace multiple items in one query

    Hello,
    I need to find and replace several bits of code in dozens of
    files in Dreamweaver CS3. I know how to find/replace for one item
    at a time using regular expressions. Is there a way to find and
    replace more than one item at at time with regular expressions? I
    know I can save and then load previous searches, but that's
    tedious. I'd like to load and then execute more
    Thanks very much for any advice.

    This is in fact the only solution I found to this problem.
    Creating an extension is not that difficult once you have the right
    reference material.
    Have a look at:
    DW API function to find and replace
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_code_cd_013.html
    Sample extension file on your machine after installing DW
    C:\Program Files\Adobe\Adobe Extension
    Manager\Samples\Dreamweaver\
    Full specifications of the MXI (extension file) format
    http://download.macromedia.com/pub/exchange/mxi_file_format.pdf
    quote:
    Originally posted by:
    Newsgroup User
    > So, is it indeed possible to run more than one
    find/replace query at a
    > time?
    As far as i know, no it's not possible.
    There has been mentions in the past to this question that a
    series of
    find/replace queries could be built as a dw extension instead
    of a saved
    search query.
    Alan
    Adobe Community Expert, dreamweaver

  • Data Manager Find- Replace

    Can we do Find Replace in Data Manager, say on one field like street ?
    for eg: I want to find all the "Avenue" or "avenue" and replace them with Ave
    I know we can do it in Import manager, but is there a reason such functionality is not provided in data manager?
    I browsed thru data manager guide and see that the menu option edit->find/replace is enabled only on object tables???!!
    Can we achieve the same functionality through assignments?
    Any inputs/leads appreciated!
    -Sudhir

    you are right Varun,
    Using Import maps was what we did originally for address standardization,
    But Value Transformation is lost if you unmap the field and remap them.
    And thats what happened to us and we didn't quite check it!
    The Data Manager route which you and some others suggested will not work , atleast in my case because:
    if you noticed in data manager
    start a selection, with say one record
    -> Add another record to the selection , you know, using the shift key
    -> you will see the details pane highlighting the differences, so far so good
    -> for street , I will not see "only Avenue", because
    A) Avenue is part of a street
    B) And data manager will not exactly "tokenize" the differences
    C) for egL if I have two street values like " 120 pennsylvania Avenue" & "5th saks Avenue", detail pane will highlight them as two distinct values and I cannot change Avenue to Ave and get the Job done.
    most importantly...
    keep on adding more records to the selection...
    When you reach 10 records, notice the detail pane still lists all the 10 distinct street address side by side for street field
    Add on more record and make the selection 11
    then alll the fields in detail pane will turn to [..]
    So I can no more go in and replace Avenue , I have to replace the entire street value with watever I type in place of [..]
    So here is my question again:
    Why is there no functionality simple like Edit->Find-> Replace just like an excel interface, I am sure it is not technologically impossible, but rather is there something basic I am missing in wishing for such facility?
    -Sudhir

  • TextEdit - Save preset for Find & Replace?

    Hey, all!
    Quick question... is there any way to save a preset for a Find & Replace function in the native TextEdit app in Mac OS?  I do a routine F&R using a long "Insert Pattern" (I haven't had time to learn Regular Expressions yet in order to use another app)... I'd love to be able to just do a quick F&R on a text file instead of having to build the string every time.
    Possible?
    Thanks!
    -=R=-

    thnx Tom - yes, all the text is there, editable and I can add new text to it and save. But I can't search it using Find, trying unique words I see right there in the first few paragraphs atop the file. Then tried 'and' which only found two in the whole large file, embedded within a block of what I guess are formatting characters also bunched up at the bottom of the file below my original text.
    Oops, I just realized now that this file is not actually an RTF, its a Word 97 .doc -- which either means I converted it at some point in TextEdit, or its the original .doc file I started long ago with my ancient Microsoft Word that I used before going to Mavericks (was able to use Word in Snow Leopard but is no longer supported in Mavericks, I think its referred to as a 'PowerPC' application.) 
    What should I do? Would converting it to an RTF file help, if so how do I do that?
    thanks!
    Randy

  • Font changes automatically in Lotus Notes & Excel Find/Replace pops up

    I am using Win XP SP3 and FF 14.0.1
    I recently (last couple of weeks) noticed that, when FF 14.0.1 is running, the font size, color, bold and bullet will change automatically in Lotus Notes. Sometimes the font changes from normal horizontal to all vertical. And these changes can reverse while I watch or continue trying to type.
    Also, in Excel 2007, the Find & Replace box will automatically pop up and keep popping up after I close it.
    My IT support suspected Malware on my laptop and loaded & ran Malwarebytes on my laptop and it found two items which I removed. But the problem was still there. Next we reinstalled Office 2007 and Lotus Notes 8.5.1 --- still did not solve the problem.
    I began my FF troubleshooting by disabling add-ons one-by-one in the reverse order of addition (newest added was disabled first) until I got to the point before which I previously did not have this problem. But this did not find an offending add-on. (I still have these add-ons disabled.)
    Next, I went brute force and restarted FF with '''ALL''' add-ons disabled (using the Help option to do so). This did '''NOT''' fix the problem.
    Then I happened to find out that the problem went away -- completely -- if FF was NOT running. I have checked / verified this several times --- somehow FF 14.0.1 certainly appears to be the cause. As I recall I only experienced these issues AFTER I updated to FF 14.0.1
    I hope a solution can be found -- otherwise I will no longer be able to use FF at work.

    Would be great if files could be attached when questions are being created. I exceeded the max allowed characters when I tried to paste my FF troubleshooting info. So, I had to delete many lines. I saved the info in a file, but no way to attach it before the question is posted.

  • Find+replace in all Pages files in a folder

    Hi,
    A simple question (?). I have a long manuscript which is a folder comprising several dozens of Pages documents. I would like to execute a find+replace command across all the individual documents (without having to open them all one by one...) I guess Applescript will be the answer, but I am not experienced in its use... Would there be a pre-existing script available? I have searched, but with no success.
    Many thanks.

    Ned is right... if the server can do it, let it.  Also - I only wish Flash had file system access on servers... but if they did - how would Adobe sell Flash Media Server?
    Google php filelist, php directory list, etc... you'll find lots of useful scripts.

  • MS Word crashes when I do find/replace

    Does anyone know what I can do about MS Word crashing when I do a find and/or replace in a document? It happens constantly. The interesting thing is that is doesn't occur every single time I do find/replace but the SECOND time I use the feature. The only way I can manage to avoid the crash is to do find/replace, then exit out of the dialog box, and then open it up again. If I do a find/replace once and then continue using the same dialog box, Word crashes. Also, find/replace doesn't work most of the time.
    Help, please!!!
    Many thanks.

    You may want to consider post your question on Microsoft's own forums for their Mac products, as they're more focused on the issue you're having then an Apple forum, as Apple forums only provide support for Apple products. Plus there's Microsoft appointed "MVPs" there to assist:
    http://www.officeformac.com/productforums

  • Flashing Finder Icon/ Question Mark on Boot

    Today I left my 1.33ghz G4 Mac Mini turned on whilst I went to the shop.
    When I came back i found it eith a flashing finder icon/ question mark.
    I restarted it and it booted up a grey screen, then after a while the flashing finder icon/question mark.
    I have tried putting in the OSX install disc and holding down the C key to start up using the CD and nothing happen, all I get is the same grey screen and flashing icon.
    I have also tried pressing the X key, and holding it down and restarting to get up the startup disk menu, but again nothing.
    Pressing 'option' key during start up only gets me a blue background with refresh button on the left and right arrow on the right - with no Boot Up CD or HDD Icon.
    I have also tried resetting the PRAM, it resets, but after it hasn't solved my problem, as i am back to square one with the boot screen and icon.
    Any help would be appreciated.
    Thanks,
    big.bad.ben

    I would agree with DP that using a wired keyboard will give better results when holding down the C key. The timing of holding down the C key is tricky, and you might have to experiment with it.
    The question mark means that the Mini can't find a bootable disk. Usually this is because the internal hard drive has enough directory damage that it is not bootable. Usually this can be fixed by reformatting the internal drive or replacing it.
    But if you truly can't boot from the install CD, that suggests a more serious problem with the logic board or RAM memory.
    When you power-up the mini, do you get a series of beeps or light flashes? The pattern of such beeps/flashes is a diagnostic aid to determine what might be wrong. Report back with what pattern you observe.
    Be sure to give the install CD some more tries, varying the timing of holding down the C key. Usually you want to do it right after the startup chime.

Maybe you are looking for