473,549 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ 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 1790
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*****@verizo n.net> wrote in message
news:%2******** *******@TK2MSFT NGP04.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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:us******** ******@TK2MSFTN GP05.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*****@verizo n.net> wrote in message
news:%2******** *******@TK2MSFT NGP04.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
5888
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 table within SQL Server. This import needs to run continuously, as more text files will be saved in the folder by a separate system and they need...
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 table within SQL Server. This import needs to run continuously, as more text files will be saved in the folder by a separate system and they need...
1
9730
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 control. It outputs all text fields surrounded by quotes, and all numeric fields w/o quotes. All fields are separated with commas. This has been...
3
3696
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 - and dump everything into a table. The problem is once I have the data imported into a new table, I can't do much with it. If I try to run an...
0
3460
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 of "none" (this is how I read to do it from newsgroups). When I use the Query window in phpmyadmin to import the text file, it waits a while,...
0
7462
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...
0
7730
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. ...
0
7975
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5381
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
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...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1957
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
1
1069
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.