Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1055.Advanced search and replace -- How to add alt attribute for all img tags in html files automatically?

User: Rod Smith -- 2013-02-17          << 1054  1056 >>
Hits: 1608
Type: Advanced search and replace   
Search all Advanced search and replace examples
Search a batch of Html files for images that are missing, or have blank attributes, replace ot insert the alt atribute with one using the image filename as its text.
Input Sample:
1)<img src="good-image.jpg" alt="">

2)<img src="good image.jpg">
Output Sample:
1)<img src="good image.jpg" alt="good image">
2))<img src="good image.jpg" alt="good image">
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Batch Runner" menu
2. drag multiple html files from windows file browser and drop to "Batch Runner" window
3. click "Fast Replace" button to open "Fast Replace" window
4. click "Add" to add new replace rules:
* set "search" to:

* set "replace" to:

* click "ok"
5. make sure "reg exp" and "cross line" options are checked
6. click "start", done.

Screenshot 1:  Fast_Replace_Window

Similar Examples:
How to add title attribute for all images in html files automatically? (92%)
How to add title attribute for all links automatically in TXT file? (68%)
How to make html tags for image file list automatically? (65%)
How to calculate the area of triangles base on 3 sides automatically? (63%)
How to extract tables from html files into csv file automatically? (62%)
How to detect encoding type of a text file automatically? (59%)
How to convert all the phrases to the Abbr automatically? (56%)
How to find the 5 largest number from a text file automatically? (56%)

Check Demo of Advanced search and replace
alt attribute  img tag  attribute  missing  images  alt  img  image  tags  tag  insert img  add attribute to all images html  insert a blank line batch  replace text in multiple files using batch  insert blank line in all text files  search and replace images batch  replace text image file batch  windows batch file insert a line multiple files