By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Manipulating Fixed Length/Width Text File

P: 3
Hi,

I would like to seek some advise and assistance regarding the following matter as I am new to VB.Net. I'll appreciate any helps render.

I am developing a VB application using VB.Net 2003 to extract data from text files and import it into datatable. The format of the text file is fixed length/width. Eg.



I am having trouble to do so as I am not sure how to start. I had done some research and notice that TextFieldParser can be use (I can switch to VB.Net 2005). However, this may not applicable as we need to define the length or width first which is not ideal for my case. The application should be able to read and calculate the length or width for any text files (not just limited to the above fixed length/width format, can be any format of fixed length/width), extract and put them in datatable.

I had used another method - using OleDbDataAdapter to extract the text files with the defined schema.ini. This approach also is not ideal as we need to define the format in schema.ini. If possible, I would like to make it all to be automatically - without defining the table format.

Any advise? Thanks!

PS: If possible, please also provide some code snippet as I am new in this area.
Sep 12 '07 #1
Share this Question
Share on Google+
1 Reply


P: 73
Hi,

I develop a component that will extract information from a textfile. all you have to do is to pass several parameters such as path&filename,length and datatype of each fields. the return value is a dataset.
you can send your email add to me and i will send you the dll file...
[EMAIL REMOVED]




Hi,

I would like to seek some advise and assistance regarding the following matter as I am new to VB.Net. I'll appreciate any helps render.

I am developing a VB application using VB.Net 2003 to extract data from text files and import it into datatable. The format of the text file is fixed length/width. Eg.



I am having trouble to do so as I am not sure how to start. I had done some research and notice that TextFieldParser can be use (I can switch to VB.Net 2005). However, this may not applicable as we need to define the length or width first which is not ideal for my case. The application should be able to read and calculate the length or width for any text files (not just limited to the above fixed length/width format, can be any format of fixed length/width), extract and put them in datatable.

I had used another method - using OleDbDataAdapter to extract the text files with the defined schema.ini. This approach also is not ideal as we need to define the format in schema.ini. If possible, I would like to make it all to be automatically - without defining the table format.

Any advise? Thanks!

PS: If possible, please also provide some code snippet as I am new in this area.
Sep 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.