Solved

Input an entire line that starts with NP-Character

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…

756 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