Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text File Drops Leading Zeros

Status
Not open for further replies.

eBartlett

Technical User
Sep 25, 2001
10
US
I routinely work with extracts where any account numbers which start with "0" or "000" appear without the leading zeros, as the data gets parsed as a text file and the leading digits get dropped. What is the best way to remedy this with VBA? The files are large and contain multiple account numbers in the first column.

Many thanks.
 
Are you parsing by VBA code, or importing as a text file? If the former, then you should be able to avoid dropping the zeroes by using

input #1, strAcct

in which strAcct is dim'd as a string. If that doesn't work, try using

line input #1, strRecord

and parsing the entire record using VBA. Still pretty easy.
Hope that helps
Rob
 
We have just been importing the data as a text file. I have a reference book on data parsing in VBA. Your comments will help me. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top