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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading and Writing Fixed-Length Files

Status
Not open for further replies.

vbnetnewby1967

Technical User
Joined
Aug 16, 2005
Messages
7
Location
US
Hello...
I was wondering if anyone could show me how to read a fixed-width file and how to go about writing a fixed-width file. I know in VB6 you could use something like:

Dim aa as String * 10
to created a fixed-width string but this is no longer supported. I have done some research on the internet and the only thing I can come up with is setting a reference Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString.
But I have no clue as to how to go about using this.
I have a large file (fixed-length) that I need to open, read and manipulate and then write the data to an output file in fixed width format.

Any assistance would be GREATLY appreciated.
 
I would use MyString.PadRight(LengthOfField, " ")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top