473,490 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Import text file problem

Hello,

I have a fixed length text file that I want to import using c#.
I want to read each line and break it apart.
The problem is when I read a line, the data is not in a fixed position, so I
cannot substring it out.
The line ends with hex 0d 0a

If I open the file in Wordpad, it looks ok, all data lines up.

How can I resolve this?

Thanks

Frank
Apr 17 '06 #1
2 1785
I don't understand the question. The 2 characters you're referring to are
carriage-return and line-feed characters, the standard Windows newline
character combination. Beyond that, I don't know what you mean by "not in a
fixed position," "substring it out," or "lines up."

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Frank" <fa*****@verizon.net> wrote in message
news:%2***************@TK2MSFTNGP04.phx.gbl...
Hello,

I have a fixed length text file that I want to import using c#.
I want to read each line and break it apart.
The problem is when I read a line, the data is not in a fixed position, so
I cannot substring it out.
The line ends with hex 0d 0a

If I open the file in Wordpad, it looks ok, all data lines up.

How can I resolve this?

Thanks

Frank

Apr 17 '06 #2
Thanks,

The substring values line up.
I was getting fooled because I was appending to a ListBox and that did not
line up.

Regards,

Frank
\
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:us**************@TK2MSFTNGP05.phx.gbl...
I don't understand the question. The 2 characters you're referring to are
carriage-return and line-feed characters, the standard Windows newline
character combination. Beyond that, I don't know what you mean by "not in a
fixed position," "substring it out," or "lines up."

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Frank" <fa*****@verizon.net> wrote in message
news:%2***************@TK2MSFTNGP04.phx.gbl...
Hello,

I have a fixed length text file that I want to import using c#.
I want to read each line and break it apart.
The problem is when I read a line, the data is not in a fixed position,
so I cannot substring it out.
The line ends with hex 0d 0a

If I open the file in Wordpad, it looks ok, all data lines up.

How can I resolve this?

Thanks

Frank


Apr 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5882
by: Chris | last post by:
Background: I am using a MS Access 2000 front end with SQL Server 8.0 back end. I have the requirement to import all text files (regardless of filename) from a given folder on the network into a...
1
676
by: Chris | last post by:
Background: I am using a MS Access 2000 front end with SQL Server 8.0 back end. I have the requirement to import all text files (regardless of filename) from a given folder on the network into a...
1
9715
by: DCM Fan | last post by:
Access 2K, SP3 on Windows 2K, SP4 All, I have an import spec set up with quoted Identifiers and comma-separated values. The text file is produced by a 3rd-party program of which I have no...
3
3691
by: deko | last post by:
I've been trying to use the Access Import Wizard to expedite importing data into my mdb. The nice thing about the wizard is that I can import from different file formats - txt, xls, even Outlook -...
0
3454
by: NewbieSupreme | last post by:
I'm using PHPMyAdmin on an Apache2Triad install (latest version; 5.x.x, which installs PHP5 and PHPMyAdmin 2.8 as well). In Access, I exported a table to a text file, tab-delimited, text qualifyer...
0
7112
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,...
0
7146
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,...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
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...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
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 ...
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.