Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

974.Regular expression replace -- How to find string in specified tag and fill it in another tag in html file?

User: Guillermo Grana -- 2012-07-20          << 973  975 >>
Hits: 1269
Type: Regular expression replace   
Search all Regular expression replace examples
Description:
I need to fill tags with file names that are in other tags, without file extension.

How can I do that please?
Input Sample:
<tag 1="">
<description></description>
<tag 2="random file name 1.ext" size="" crc="" md5="" sha1=""/>
</tag 3>

<tag 1="">
<description></description>
<tag 2="random file name 2.ext" size="" crc="" md5="" sha1=""/>
</tag 3>

<tag 1="">
<description></description>
<tag 2="random file name 3.ext" size="" crc="" md5="" sha1=""/>
</tag 3>
Output Sample:
<tag 1="random file name 1">
<description></description>
<tag 2="random file name 1.ext" size="" crc="" md5="" sha1=""/>
</tag 3>

<tag 1="random file name 2">
<description></description>
<tag 2="random file name 2.ext" size="" crc="" md5="" sha1=""/>
</tag 3>

<tag 1="random file name 3">
<description></description>
<tag 2="random file name 3.ext" size="" crc="" md5="" sha1=""/>
</tag 3>
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Following procedure will take "filename.ext" from tag2 and fill "filename" in tag1:

1. ctrl-o open html file
2. ctrl-h open 'replace' dialogue
* set 'search for pattern' to:

* set 'replace with pattern' to:

3. click 'replace', done.

Screenshot 1:  Replace_Window


Similar Examples:
How to move some words from start of line to specified location in html file? (58%)
How to extract all specified links from a html file? (56%)
How to extract all specified date format from a text file? (56%)
How to add bold tag for some specified keywords in multiple html files? (55%)
How to replace a string in one text file with random words from another file? (55%)
How to extract specified interface and sw from router configuration file? (54%)
How to change all bold tag to bold-italic tag in multiple html files? (54%)
How to insert mulitple text files into multiple html files? (53%)

Check Demo of Regular expression replace
Keywords:
find string  file extension  extension  desc  tags  without  script  scrip  tag  scr  filename without  find string replace  find and replace filename  replace string with filename  filename find  replace replace replace html tags  tags html  replace tags