Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Read txt File and Compare

Reply
Thread Tools

Read txt File and Compare

 
 
Simon Gare
Guest
Posts: n/a
 
      04-17-2007
Hi all,

have a text file that is read in an asp page

<%
Dim arrFileLines()
i = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile =
objFSO.OpenTextFile("D:\Inetpub\Websites\AmacExpre ssServices\Constants\areas
..txt", 1)

Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close

%>

What i need to do further down is something like this to change the row bg
color.

<<% IF arrFileLines() <> BookingForm.Fields.Item("COLL_CITY_TOWN").Value
Then response.write "style='background=#CCCCFF'"%>>

Doesnt work like in this format.

Regards
Simon

--
Simon Gare
The Gare Group Limited

website: www.thegaregroup.co.uk
website: www.privatehiresolutions.co.uk


 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      04-18-2007

"Simon Gare" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> have a text file that is read in an asp page
>
> <%
> Dim arrFileLines()
> i = 0
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objFile =
>

objFSO.OpenTextFile("D:\Inetpub\Websites\AmacExpre ssServices\Constants\areas
> .txt", 1)
>
> Do Until objFile.AtEndOfStream
> Redim Preserve arrFileLines(i)
> arrFileLines(i) = objFile.ReadLine
> i = i + 1
> Loop
> objFile.Close
>
> %>
>
> What i need to do further down is something like this to change the row bg
> color.
>
> <<% IF arrFileLines() <> BookingForm.Fields.Item("COLL_CITY_TOWN").Value
> Then response.write "style='background=#CCCCFF'"%>>
>
> Doesnt work like in this format.


try:- style="background-color:#CCCCFF"

http://www.w3.org/TR/REC-CSS2/colors...und-properties

Note that an inline style attribute should contain syntax that is valid
between { } in a style element or a CSS file.

>
> Regards
> Simon
>
> --
> Simon Gare
> The Gare Group Limited
>
> website: www.thegaregroup.co.uk
> website: www.privatehiresolutions.co.uk
>
>



 
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
counting how often the same word appears in a txt file...But my codeonly prints the last line entry in the txt file dgcosgrave@gmail.com Python 8 12-19-2012 06:29 PM
Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Jochen Brenzlinger Java 7 09-15-2011 01:23 AM
Read xml file and write data to a txt file using PERL.... urgent Ram Perl Misc 3 04-26-2007 12:23 PM
Opening a txt file to view ( i.e. readme.txt) Sameen C++ 2 08-29-2005 03:14 PM
get today's date and compare to txt Field peashoe@yahoo.com ASP General 8 01-24-2005 08:22 PM



Advertisments