ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 9th, 2004, 02:43 PM
buckenmeyer buckenmeyer is offline
eternal novice
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Madrid
Posts: 455 buckenmeyer User rank is Private First Class (20 - 50 Reputation Level)buckenmeyer User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 3 h 41 m 23 sec
Reputation Power: 8
Send a message via Yahoo to buckenmeyer
editing into table from file

hello,

I'm printing part of a table from one asp page to another
using Server.CreateObject.

the table is like so (simplified)


<table><tr>
<td bgcolor="red" colspan="5">some number</td>
</tr><tr>
<td bgcolor="#c0c0c0">Figura</b></td>
<td bgcolor="#c0c0c0" colspan="2">Referencia</td>
<td bgcolor="#c0c0c0">Descripción</td>
<td bgcolor="#c0c0c0">Ctd.</td>
</tr>
<!-- this 3rd row below repeats many time with
different values ->
<tr>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">some value</td>
</tr>

When the script prints out the table from the
previous page i need 2 more columns added so now
the table would look like so (changes in bold):

<table><tr>
<td bgcolor="red" colspan="7">some number</td>
</tr><tr>
<td bgcolor="#c0c0c0">Figura</b></td>
<td bgcolor="#c0c0c0" colspan="2">Referencia</td>
<td bgcolor="#c0c0c0">Descripción</td>
<td bgcolor="#c0c0c0">Ctd.</td>
<td bgcolor="#c0c0c0">1st extra field</td>
<td bgcolor="#c0c0c0">2nd extra field</td>

</tr>
<!-- this 3rd row below repeats many time with
different values ->
<tr>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">some value</td>
<td bgcolor="#E1E1E1">blank</td>
<td bgcolor="#E1E1E1">blank</td>

</tr>

-------------------------
I have this code, it prints out the table ok, but the problem
is sticking in the extra cells..
------------------------
PHP Code:
 Set objFSO  Server.CreateObject("Scripting.FileSystemObject"

Set objFile objFSO.GetFile(file)

Set ReadFile =  objFile.OpenAsTextStream(1, -2)

varContents ReadFile.ReadAll

Dim arrContents

'This is going to split your file, based on carriage returns, which should give you an array with each line in an element on   the array.  vbCrlf is the indicator for carriage returns.

arrContents = Split(varContents, vbCrlf)

'
Create a variable to loop through the array
0
 
'Loop through from i = 0 to the UBound of the Array
For i = 0 to UBound(arrContents)

'
This is going to loop through the array and not start "recording" until it finds tblDistinctName in the string.

If 
Instr(arrContents(i), "tblDistinctName") <> 0 Then

Do Until Instr(arrContents(i), "<!-- first set end -->") <> 0

response
.write Replace(arrContents(i), "</tr>""<td bgcolor='#E1E1E1' align='center'  class='s2'>&nbsp;</td><td  bgcolor='#E1E1E1' align='center' class='s2'>&nbsp;</td></tr>")



1
Loop
     
End 
If 

1

Next 


any suggestions would be highly appreciated

Last edited by buckenmeyer : February 9th, 2004 at 02:51 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > editing into table from file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT