473,748 Members | 6,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manipulating Fixed Length/Width Text File

3 New Member
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 OleDbDataAdapte r 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
1 3180
aliasruel
73 New Member
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,l ength 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 OleDbDataAdapte r 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

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

Similar topics

9
8003
by: John F Dutcher | last post by:
I use code like the following to retrieve fields from a form: recd = recd.append(string.ljust(form.getfirst("lname",' '),15)) recd.append(string.ljust(form.getfirst("fname",' '),15)) etc., etc. The intent is to finish by assigning the list to a string that I would write to disk: recstr = string.join(recd,'')
4
2003
by: Charles Russell | last post by:
I am trying to have a fixed top and side sections with scrolling content. Both side sections have navigation links. The side provides external navigation and the top provides internal navigation. The styles I have defined work fine until I move to an internal link. When moving to the internal link the header vanishes. This is the style definition as it now stands: /*Creates a fixed left sidebar and header with scrolling content */...
28
5735
by: Gabriel | last post by:
greetings, I want to achieve the following effect : Menu1 | Menu2 | Menu3 | Menu4 | Menu5 | I played with padding, border-width and the like and it's ok for the | . My problem is that menu1 could be longer than menu2 : Products and FAQ for example. But all lengths will be smaller than say : 800/6 (menus) pixels.
5
11596
by: Johnny Meredith | last post by:
I have seven huge fixed width text file that I need to import to Access. They contain headers, subtotals, etc. that are not needed. There is also some corrupt data that we know about and can correct once the data is in Access (or during the import process itself). Furthermore, the text files are poorly set up, such that some records may be "shifted" over a few characters, and therefore the fixed width nature of the file is corrupted. ...
10
399
by: Segfahlt | last post by:
I have a fairly simple C# program that just needs to open up a fixed width file, convert each record to tab delimited and append a field to the end of it. The input files are between 300M and 600M. I've tried every memory conservation trick I know in my conversion program, and a bunch I picked up from reading some of the MSDN C# blogs, but still my program ends up using hundreds and hundreds of megs of ram. It is also taking...
4
2146
by: John | last post by:
I can create text file, but how can I create a text file where the values are at the same location on every line? I want to define the location where the values starts and define the length of the value.
2
5878
by: spacix | last post by:
Does anyone know a work around for "table-layout: fixed;" to prevent the automatic evenly space cells width without assigning classes or ID to cells? My program prints a HTML "report" file and I used "table-layout: fixed; width:691px;" because the reports have to be printed on 8.5x11 paper. I didn't want the table to resize or anything. Then after I added that property to the table, the data cells no longer "fit to contents" even with a...
4
4003
by: Jeff | last post by:
Hey I'm wondering how the Fixed-Width Text Format is What I know is that the top line in this text format will contain column names. and each row beneath the top line represent for example a row in a table etc... But does fixed-with mean that every column has a fixed with: for example first column is 10 char wide and second column is 30 char wide?
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.