Question about reading file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Question about reading file

  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 08:04 PM.

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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center