Solved

Left() and Mid() reading tab spacing

Posted on 2003-10-26
4
262 Views
Last Modified: 2010-05-03
i have tabs separating fields in a .txt file.

the only way that i can get the Left() or Mid() statement to work right is if i take out the tabs and put in all spaces up to the max character position.
is there any way that i can read tab spaces. my code says:

    If thefile.AtEndOfStream = False Then
        thetext = thefile.ReadLine
        lblname.Caption = Left(thetext, 24)
    End If

(with tab spacing), when i put a breakpoint in my program, i want thetext to read "Timmy Thompson", but instead it reads "Timmy Thompson[]13[]OH[]".....where 13 and OH are age and state. but still it doesn't read the tabspacing.

i know this may not seem real clear, but either is my head right now....if you need more specification, let me know....otherwise, your help is appreciated.
jeremy
0
Comment
Question by:Jeremy Daley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
fantasy1001 earned 25 total points
ID: 9624711
use array
dim myarray() as string
myarray = split (thetext, "[]")

'myarray(0) is the name

Thank & cheers
0
 
LVL 7

Expert Comment

by:_agj_
ID: 9625021
u cud do a :
string1 = Replace(string1, vbtab, " ")
0
 
LVL 4

Author Comment

by:Jeremy Daley
ID: 9627881
i'll give the "replace" a try and get back to ya...
0
 
LVL 4

Author Comment

by:Jeremy Daley
ID: 9628412
the replace didn't work because it only puts one space for each tab which isn't what i was looking for. the array worked perfectly except i just used "vbTab" in place of the "[]"....

awesome...thanks...now i know something about "split"
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question