Solved

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

Posted on 2004-08-08
2
194 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now