473,378 Members | 1,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Using PHP offline to manipulate text files

I need to create an application that will do fairly simple text manipulation
on 20,000 files in text format (html files). The files exist both on my
Windows machine and on a FreeBSD server. I prefer to do the manipulation on
my machine where it's easier to create backup copies, recover from
programming errors and so on, then upload the files to the server. All I'm
doing is extracting certain elements from each file and creating a different
file with the same content that will look better. I could do this in
FrontPage (or even Notepad) if I didn't have 20,000 files, so I need to
write an application that go through each file in a directory, open it,
locate the relevant text elements and create a new file that has these text
elements in an appropriate format.

I'm comfortable that I can write an application like this in PHP, even
though I do not have PHP installed on my computer, which is a Windows box
and is not being used as a server. Does this make sense? Can I install and
use PHP for this purpose without lots of server-related baggage? Any
pointers on using PHP this way?

TIA
Jul 17 '05 #1
3 4501
Without the server-related baggage means you'll be limited to the CLI
version of PHP (which will run from any batch file for any DOS in
Windows including XP). I wrote a simple script myself that works under
the CLI version to clean multiple mailboxes in a mail directory.
You're more than welcome to it, if CLI is the route you take.

Richard

On Sun, 14 Dec 2003 13:25:19 -0600, "Anonymous" <an**@fairmark.com>
wrote:
I need to create an application that will do fairly simple text manipulation
on 20,000 files in text format (html files). The files exist both on my
Windows machine and on a FreeBSD server. I prefer to do the manipulation on
my machine where it's easier to create backup copies, recover from
programming errors and so on, then upload the files to the server. All I'm
doing is extracting certain elements from each file and creating a different
file with the same content that will look better. I could do this in
FrontPage (or even Notepad) if I didn't have 20,000 files, so I need to
write an application that go through each file in a directory, open it,
locate the relevant text elements and create a new file that has these text
elements in an appropriate format.

I'm comfortable that I can write an application like this in PHP, even
though I do not have PHP installed on my computer, which is a Windows box
and is not being used as a server. Does this make sense? Can I install and
use PHP for this purpose without lots of server-related baggage? Any
pointers on using PHP this way?

TIA


Jul 17 '05 #2
Ron
On Sun, 14 Dec 2003 13:25:19 -0600, "Anonymous" <an**@fairmark.com>
wrote:
I need to create an application that will do fairly simple text manipulation
on 20,000 files in text format (html files). The files exist both on my
Windows machine and on a FreeBSD server. I prefer to do the manipulation on
my machine where it's easier to create backup copies, recover from
programming errors and so on, then upload the files to the server. All I'm
doing is extracting certain elements from each file and creating a different
file with the same content that will look better. I could do this in
FrontPage (or even Notepad) if I didn't have 20,000 files, so I need to
write an application that go through each file in a directory, open it,
locate the relevant text elements and create a new file that has these text
elements in an appropriate format.

I'm comfortable that I can write an application like this in PHP, even
though I do not have PHP installed on my computer, which is a Windows box
and is not being used as a server. Does this make sense? Can I install and
use PHP for this purpose without lots of server-related baggage? Any
pointers on using PHP this way?

TIA

If you are doing a search and replace why not use Dreamweaver? It's
definitely in the full version and maybe in a trial version but it
lets you do a find and replace in all files in the same folder. I've
done it with 500 files but I'm not sure with 20000. Good luck.

thx..ron
Jul 17 '05 #3
> If you are doing a search and replace why not use Dreamweaver? It's
definitely in the full version and maybe in a trial version but it
lets you do a find and replace in all files in the same folder. I've
done it with 500 files but I'm not sure with 20000. Good luck.


I think I need something more powerful than multi-file search and replace
because I'm actually extracting several key elements from each of the
existing pages and creating a new page in an entirely different format
containing those elements. I could play with this concept, but it seems more
straightforward to write a little application that opens each file, extracts
the necessary information into a half-dozen variables, then writes a new
file to replace the old one.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: ross | last post by:
I want to do some tricky text file manipulation on many files, but have only a little programming knowledge. What are the ideal languages for the following examples? 1. Starting from a certain...
4
by: NohaKhalifa | last post by:
Dear All; I'm developing a web site and i need to make adminisration for this site it's a site for Real Estates . But I don't need the administration to be online .. I want them to fill data...
0
by: moko | last post by:
This is a bit long-winded. Can somebody read thru these 2 use cases, and tell me if it is feasible ? :- Use Case : Replication before Offline Synch Scenario 1 : Oracle Server , MSDE client ...
1
by: Terry Wilson | last post by:
I have what I think is a very simple question, but so far I have been unable t find the answer I have developed a small web based application that we will ship with one o our products. I...
4
by: manwiththeaxe.70 | last post by:
I have recently begun to migrate our DB2 UDB v7.2 enterprise databases up to DB2 UDB v8.2. One question I can't seem to understand is why would I want to run an offline backup for a database now...
2
by: Steve Hershoff | last post by:
Hi everyone, I'm going to manipulate some XML files in my next project-- crawl through the tags, compare if file X has the same nodes as file Y, and if not, what the differences are and who's...
1
by: =?Utf-8?B?QW5kcmV3IFA=?= | last post by:
I'm having trouble setting up offline folders with encryption under WinXP. I've followed the guidance provided here: http://support.microsoft.com/kb/312221 but when I try to synchronise I get...
10
by: Michael Hoffmann | last post by:
Hello, I hope this doesn't come across as totally newbieish, but I've been searching the web and the IBM docs until smoke is coming out of my head. Scenario: We are trying to take primitive...
1
by: pavanip | last post by:
hi, I have an application that will find Firefox browing history, Auto complete datalist, Temp offline files and Find Computer list. please give me some idea on Auto complete datalist, Temp offline...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.