writing tab delimited files into an array-VBForums
Results 1 to 2 of 2

Thread: writing tab delimited files into an array

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2014

    writing tab delimited files into an array

    I have a text file called text.txt in the location C:\testfolder
    in this file there are four values separated by tab (chr(9)) values like so (note that (chr(9) represents a tab spacing and not actual text): test1(chr(9))test2(chr(9)test3(chr(9)test(4)

    I need a function that reads each value into an array by separating the values based on an encounter with a tab spacing i.e.
    egarray(0) = test1
    egarray(1) = test2
    egarray(2) = test3
    egarray(3) = test4


  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: writing tab delimited files into an array

    If there's just one line in the file then I'd think that calling File.ReadAllText to read the file into a String and then calling Split on that String to create an array would be the way to go. You can pass ControlChars.Tab as an argument to String.Split.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width

Survey posted by VBForums.