Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Input an entire line that starts with NP-Character

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
gsaksa
Asked:
gsaksa
  • 2
1 Solution
 
sirbountyCommented:
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
 
sirbountyCommented:
Or, you could even replace the tab with another character...

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

Then split on that character...
0
 
gsaksaAuthor Commented:
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!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now