469,282 Members | 1,732 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

File System Object

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

Jul 19 '05 #1
1 1467
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!
************************************************
"JP SIngh" <no**@none.com> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
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

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Skc | last post: by
1 post views Thread by apple | last post: by
19 posts views Thread by Lee Crabtree | last post: by
4 posts views Thread by MikeJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.