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 June 29th, 2005, 12:51 PM
jaguar jaguar is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 62 jaguar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 59 m 14 sec
Reputation Power: 4
how to open, edit and export .txt file?

I have a .txt file that looks like this:

Code:
1999 1 1 12:00 73 5.3


the numbers stand for: year, month, date, time, temperature, and wind speed respectively. There are many more entries like this in the .txt file (about 1000).

3 Questions:

1. How do I use vbscript to go through every line and replace spaces with commas?
Code:
1999,1,1,1200,73,5.3


2. If I want to add a value of -99 after a specific comma, for example, after "1200," how do i do this?

3. How do I export the above to an Access table?

thank you very much.

Reply With Quote
  #2  
Old July 1st, 2005, 06:40 PM
cix3lsid cix3lsid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 8 cix3lsid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 44 m 20 sec
Reputation Power: 0
I know in VB you can use the replace method to achieve this IE,

Replace(letters, "", ",")
letters being the string variable
That would work if there is only one whitespace inbetween each entry. Other wise it would replace each null value with a comma
IE 1200,,,,12,,,12,,,13,2000

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > how to open, edit and export .txt 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 2 hosted by Hostway
Stay green...Green IT