Solved

How do you process a .txt file and then parse it with string commands.

Posted on 2004-08-08
2
200 Views
Last Modified: 2010-04-23
I am processing a text file that is approximately 4000 characters wide and about 4000 records long.  There is no seperation in the file.  I only know the start and stop positions for each field.  I need to extract each field into a variable and then write it to a SQL database.  Can someone give me some ideas on how to do perform this job.  Thanks for your help.

Kenny
0
Comment
Question by:kwh3856
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 11749796
well you will be reading it as a stream ...

http://www.experts-exchange.com/Programming/Q_21014373.html shows one ...

you could also use random access if you wanted wich will make things a bit easier in code ... http://www.codeproject.com/vb/net/ybrandomfile.asp gives an example of this, this method is nice because it reads directly into a structure.
0
 

Author Comment

by:kwh3856
ID: 11749842
Gregory,
Thanks for steering me in the right direction.  I found this link at Microsoft which was exactly what I needed.

Thanks
Kenny

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconReadingTextFromFile.asp

0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question