LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2005, 10:13 AM   #1
mrobertson
Member
 
Registered: May 2005
Posts: 275

Rep: Reputation: 30
vb.net writing to a specific line in a text file


am trying to write an vb.net app that will read a text file, look for specific lines and when they are found....replace that line with something else leaving the rest of the file the same. The file order must stay in tact, that is I can not just append to the end or beginning. The change needs to be made exactly where the line occurs in the text file. Can anyone help me as to how this would be done?
 
Old 12-30-2005, 11:20 AM   #2
TruongAn
Member
 
Registered: Dec 2004
Location: Vietnam (Việt Nam)
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728

Rep: Reputation: 33
I assumed that vb.net is Microsoft Visual Basic .Net right?

Therefore it is not a linux issue.

But as I remember (I have give up windows for half a years), you will have to use stream to do so.
Go to MSDN website or get the MSDN CD and search for the details about how to use stream.

I have written a program on VB.Net which can operate with text file.
It didn't solve your problem directly, but you can use it for an example (or use it instead of notepad) about how to use stream.
That is not a good soft but I hope it have something helpful for you.
Download it at http://super-write.sourceforge.net
 
Old 12-30-2005, 01:38 PM   #3
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
De Ja Vu anyone..
 
Old 12-30-2005, 10:24 PM   #4
TruongAn
Member
 
Registered: Dec 2004
Location: Vietnam (Việt Nam)
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728

Rep: Reputation: 33
Quote:
Originally Posted by xhi
De Ja Vu anyone..
Forgive me for my poor English, but can you express your idea in a easier to understand way?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to a specific line in a text file mrobertson Programming 6 12-30-2005 04:02 PM
SED - display text on specific line of text file 3saul Linux - Software 3 12-29-2005 04:32 PM
vb.net reading and writing to a text file simultaneously mrobertson Programming 3 09-08-2005 12:30 PM
Writing to a text file vb.net mrobertson Programming 5 08-04-2005 12:37 PM
Shell script - how to show a specific line of a text file davi_cabral Linux - Software 3 09-28-2004 01:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration