Solved

Input an entire line that starts with NP-Character

Posted on 2004-04-14
3
240 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now