> On Behalf Of Mark
> This line should be:
>
> sed "s/\.htm$/.php/g" < $each > /tmp/$$
I think a more robust way to go about this would be:
(1) Use os.walk to walk through the directory
http://docs.python.org/lib/os-file-dir.html
(2) Use Beautiful Soup to extract the internal links from each
On Thu, 23 Aug 2007 12:27:10 -0700, Tobiah wrote:
> sed "s/.htm/.php/g" < $each > /tmp/$$
This line should be:
sed "s/\.htm$/.php/g" < $each > /tmp/$$
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hi,
>
> I have a bunch of files that have changed from standard htm files to
> php files but all the links inside the site are now broken because
> they point to the .htm files while they are now .php files.
>
> Does anyone have an idea about how to do a simple script t
On 24/08/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote:
> Tim Williams wrote:
> > On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >> Hi,
> >>
> >> I have a bunch of files that have changed from standard htm files to
> >> php files but all the links inside the site are now broken becau
I'd actually skip checking where the links are coming from, and just
pretend any link could be .htm or .html.
Check for both cases, either using a regex or just fix the .html cases
first. So do 2 passes.
Pass 1: Data.replace('.html', '.php')
Pass 2: Data.replace('.htm','.php')
I make no cl
Tim Williams wrote:
On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi,
I have a bunch of files that have changed from standard htm files to
php files but all the links inside the site are now broken because
they point to the .htm files while they are now .php files.
Does anyone h
On 23/08/07, Tim Williams <[EMAIL PROTECTED]> wrote:
> On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have a bunch of files that have changed from standard htm files to
> > php files but all the links inside the site are now broken because
> > they point to the .htm fil
On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a bunch of files that have changed from standard htm files to
> php files but all the links inside the site are now broken because
> they point to the .htm files while they are now .php files.
>
> Does anyone have an idea ab