DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    8

    Question Question about reading file

    I'm reading a file into an array where I'd like to not have it include commas into the string it reads into. Currently with the code below, when it encounters a comma or a new line it loads into a separate array. Can I specify the character I use to separate the file to something other than a comma?

    Open varDir For Input As #5
    Do Until EOF(5)
    Input #5, strAllString(i)
    i = i + 1
    Loop
    Close #5

  2. #2
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    Use LINE INPUT - this will read line by line into a string (incl commas) and you can then parse it yourself (incl removing commas if you want to).
    You may want to look at the Split function as well.
    Last edited by gupex; 02-27-2005 at 07:04 PM.

  3. #3
    Join Date
    Feb 2005
    Posts
    8
    Worked perfectly, thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links