Solved

Input an entire line that starts with NP-Character

Posted on 2004-04-14
3
247 Views
Last Modified: 2010-05-02
I am writing a program to process data from a tab-delimited text file.

I am processing the information one line at a time.  While processing input, I have noticed that lines that have a blank leading field are being shortened.  

For example:

Name         Address            Zip Code

George       1 Small St        16709
Adam         9 Main St         15206
                 12 Jury Ln        90210

When the information is being read...

  The lines will appear

      George[Tab]1 Small St[Tab]16709
      Adam[Tab]9 Main St[Tab]15206
      12 Jury Ln[Tab]90210

Is there a way that I can force VB 6 to read the leading tab?

The reason is that I'm trying to use Split() to take the tabs out, and in the first process am creating a list of the zip codes by comparing strSplit(2).
0
Comment
Question by:gsaksa
[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
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 75 total points
ID: 10828097
How about this...

Opening the file, I suppose you've got.

So,

Line Input #1, strData
if instr(1,strData,vbtab) < 4 then strData=vbTab & strData

...??
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 10828101
Or, you could even replace the tab with another character...

strData2=replace(strData,vbtab,"|")

Then split on that character...
0
 

Author Comment

by:gsaksa
ID: 10832588
Thanks so much!  I'd have never thought of that!
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

632 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