File System Object

J

JP SIngh

Can some tell me how can I search for a particular block of text within the
file and delete it?

Section of the file I want to change looks like the one below and I want all
the lines starting with dteHolidays[ deleted?

/* INSERT HOLIDAYS HERE!
*/

dteHolidays[0] = new Date("01/01/2004"); // CHRISTMAS DAY
dteHolidays[1] = new Date("04/09/2004"); // Good Friday
dteHolidays[2] = new Date("04/12/2004"); // Easter Monday


Any help

thanks
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

Any time you have a file, you have two options.

1. Read in line by line and parse out what you do not want (or replace).
With the ASP/COM FSO, the easiest method is to write to another file
location and copy back in.

2. Read in the entire file, as a chunk and replace. Then save on top of the
old file. With large files this may end up being rather clunky.

Better option:
Add a routine that looks up the info you want and have it called from within
the page. When there is no data to show, return an empty string.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top