Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic 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 ASP Free Forums Sponsor:
  #1  
Old September 13th, 2004, 09:11 AM
nluoma nluoma is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 5 nluoma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 32 sec
Reputation Power: 0
Searching and Writing to a Text File

I am using Access to manage a multi-format, multi-language web site. I need to write information from two different tables to a single text file. Because of the work I have already done, and to avoid creating any new tables, the easiest thing to do would be to run my first macro, which would write to the text file and leave a marker (which could be anything that would be easy to find, I figured a comment which would be invisible to the browser). I then want to create a second macro which would open the text file, locate the marker, and replace it with data from the second table.
Is it possible to do this?
Thanks!

Reply With Quote
  #2  
Old September 15th, 2004, 09:08 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 5
Quote:
Originally Posted by nluoma
I am using Access to manage a multi-format, multi-language web site. I need to write information from two different tables to a single text file. Because of the work I have already done, and to avoid creating any new tables, the easiest thing to do would be to run my first macro, which would write to the text file and leave a marker (which could be anything that would be easy to find, I figured a comment which would be invisible to the browser). I then want to create a second macro which would open the text file, locate the marker, and replace it with data from the second table.
Is it possible to do this?
Thanks!

I don't fully undestand, you are trying to replace text of concatenate the two tables in an ascii file?

If you are replacing text, why don't filter the first table before creating the file, ones the text file is created, you only replace in a text file taking it as a binary file and using put and get functions (both functions exists long time ago, I am not sure if in VB exists), replacing records of an "ascii database", another way could be to use a richtextbox, put the first table, select the text to replace, replace it and send it to a file

If concatenation is needed, you can use "Open filename for append as #1", and concatenate the second table to the file (just closed).

Reply With Quote
  #3  
Old September 15th, 2004, 03:16 PM
nluoma nluoma is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 5 nluoma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 32 sec
Reputation Power: 0
Clearer description of problem

As I understand it, using Open for Append will add the new content to the end of the previous document. I need to add the content in the middle of the document. The problem is that the second table is a list of legal fields to use, which must be sorted alphabetically, depending on the language of the content. The first table is the remaining content for the page, which must be sorted on an order field. In addition, as I am managing 10 languages, each of which have approximately 20 different variants, the loops are getting complicated and I'm pushing the memory limits. I'd like to do this in two passes--create all the files from the first table, then add content to the three files that need the field lists added.
What I want to do is open the file, search for <--*****--> and write the new content to that location.



Quote:
Originally Posted by Darius
I don't fully undestand, you are trying to replace text of concatenate the two tables in an ascii file?

If you are replacing text, why don't filter the first table before creating the file, ones the text file is created, you only replace in a text file taking it as a binary file and using put and get functions (both functions exists long time ago, I am not sure if in VB exists), replacing records of an "ascii database", another way could be to use a richtextbox, put the first table, select the text to replace, replace it and send it to a file

If concatenation is needed, you can use "Open filename for append as #1", and concatenate the second table to the file (just closed).

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Searching and Writing to a Text 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


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





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