Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > File System Object

Reply
Thread Tools

File System Object

 
 
JP SIngh
Guest
Posts: n/a
 
      07-15-2004
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



 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\) [MVP]
Guest
Posts: n/a
 
      07-15-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File System Object - not deleting file Lise ASP General 3 06-08-2006 03:14 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
System.Security.SecurityException: Error de solicitud de permiso de tipo System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. Luis Esteban Valencia ASP .Net 0 07-14-2005 01:43 PM
Why are sender and object used as in sender As System.Object, ByVal e As System.EventArgs? Showjumper ASP .Net 2 08-02-2003 10:53 PM



Advertisments