Including Filename & External Data
Including Filename & External Data
Hello,
I am creating product pages for a website. There are thousands of beads - Each one has an img file, and a .doc file (containing that particular bead's description). The img file names are the same as the .doc names, reflecting the particular beads product # - For example, bead #11145 is shown in img file 11145.jpg, and described in 11145.doc. I have a basic template setup for these pages, say 11145.html. I can't seem to get Find & Replace to take 11145.html, and insert it's filename (11145) into the HTML (ex: img src=FILENAME, and Description: [inserted from 11145.doc) - Is any of what I'm describing possible to do with this program? Please let me know, thanks!
I am creating product pages for a website. There are thousands of beads - Each one has an img file, and a .doc file (containing that particular bead's description). The img file names are the same as the .doc names, reflecting the particular beads product # - For example, bead #11145 is shown in img file 11145.jpg, and described in 11145.doc. I have a basic template setup for these pages, say 11145.html. I can't seem to get Find & Replace to take 11145.html, and insert it's filename (11145) into the HTML (ex: img src=FILENAME, and Description: [inserted from 11145.doc) - Is any of what I'm describing possible to do with this program? Please let me know, thanks!
Hello,
You cannot take description from 11145.doc (in current version of the software)
But you can "take 11145.html, and insert it's filename (11145) into the HTML (ex: img src=FILENAME)"
Please read about "Include File Name into Search Scope" option on the
following page:
http://www.abacre.com/afr/manual/optsbatch.htm
So you should use Batch Replace operation with checked "Include File Name into Search Scope" and "Use regular expression" options.
Then create needed regular expression for this case.
You cannot take description from 11145.doc (in current version of the software)
But you can "take 11145.html, and insert it's filename (11145) into the HTML (ex: img src=FILENAME)"
Please read about "Include File Name into Search Scope" option on the
following page:
http://www.abacre.com/afr/manual/optsbatch.htm
So you should use Batch Replace operation with checked "Include File Name into Search Scope" and "Use regular expression" options.
Then create needed regular expression for this case.
Wally,
Do you work with Word/Excel files or with text files (TXT, HTML, ASP
or others)?
Adding file name to the end of file is quite easy task.
What you you mean in your example:
Text: XXXXXXX.com/ +FILENAME
What is source text of the file and what text should be after
transformation (adding filename).
Do you need to add only file name or full path + file name?
Do you work with Word/Excel files or with text files (TXT, HTML, ASP
or others)?
Adding file name to the end of file is quite easy task.
What you you mean in your example:
Text: XXXXXXX.com/ +FILENAME
What is source text of the file and what text should be after
transformation (adding filename).
Do you need to add only file name or full path + file name?
I am working with .html files named, p3712.html, p3713.html, p3714.html etc. (I don't need the path)
I want to change the contents of each of the files, adding the file name to the end of http://www.booksofthebible.com. All files have the same content.
All Files
From:
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com");
exit();
?></HTML>
file p3712.html
To:
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3712.html");
exit();
?></HTML>
file p3713.html
To:
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3713.html");
exit();
?></HTML>
etc..
Thank you in advance,
Wally
I want to change the contents of each of the files, adding the file name to the end of http://www.booksofthebible.com. All files have the same content.
All Files
From:
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com");
exit();
?></HTML>
file p3712.html
To:
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3712.html");
exit();
?></HTML>
file p3713.html
To:
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3713.html");
exit();
?></HTML>
etc..
Thank you in advance,
Wally
Wally
The to: was the contents of the result files:
These are the result files
p3712.html This is the file name
To: this is the result I want
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3712.html");
exit();
?></HTML>
p3713.html This is the file name
To: this is the result I want
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3713.html");
exit();
?></HTML>
I'm starting out with the generic
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com");
exit();
?></HTML>
Wally
These are the result files
p3712.html This is the file name
To: this is the result I want
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3712.html");
exit();
?></HTML>
p3713.html This is the file name
To: this is the result I want
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com/p3713.html");
exit();
?></HTML>
I'm starting out with the generic
<HTML><?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.booksofthebible.com");
exit();
?></HTML>
Wally
Wally
Ok. Step-by-step instructions:
Go to main menu - Action - Options - Batch Replace
check "Include file name into search scope"
check "Modifier S"
check "Modifier G"
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
.*\\(.*html)\r\n(.*Location: http://www\.booksofthebible\.com)
Replace with:
\r\n$2/$1
That's all I verified it works perfectly.
Go to main menu - Action - Options - Batch Replace
check "Include file name into search scope"
check "Modifier S"
check "Modifier G"
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
.*\\(.*html)\r\n(.*Location: http://www\.booksofthebible\.com)
Replace with:
\r\n$2/$1
That's all I verified it works perfectly.

Do you have any directions anywhere for the modifiers and what does \r\n$2/$1 do?
It's not clear how to use this program unless there is more to "help" than I am seeing.
Thanks again for making my liofe a little easier. I spent a few hours trying to figure this out without success.
Wally
Wally