473,324 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Editing text files

ALF
What's easiest way to replace a particular text string in
a text file by another and save the modified file?

Currently I know how to open a file, read the text
string, place it in a variable, and modify the string.
What I'd like to know is how to save the modified string
in the same file.

The alternative that's I'm trying to avoid is to create a
temporary auxiliary file in the process.

Any help is appreciated

Thanks
ALF
Nov 20 '05 #1
4 1126
Cor
Hi ALF,

Is it a textfile form one string or a textfile with lines with CRLF in it?

Cor
Nov 20 '05 #2
ALF
It is a text file with lines with CRLF in it.
-----Original Message-----
Hi ALF,

Is it a textfile form one string or a textfile with lines with CRLF in it?
Cor
.

Nov 20 '05 #3
* "ALF" <an*******@discussions.microsoft.com> scripsit:
It is a text file with lines with CRLF in it.


I think the way to go depends on the size of the file. The solution
will be different if files are always very small and if the file's size
is 2 GB.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
ALF
The file size will never exceed 4 MB.

ALF
-----Original Message-----
* "ALF" <an*******@discussions.microsoft.com> scripsit:
It is a text file with lines with CRLF in it.
I think the way to go depends on the size of the file.

The solutionwill be different if files are always very small and if the file's sizeis 2 GB.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #5

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

Similar topics

4
by: Dan Weeb | last post by:
Hi All, I have struggled through this far with help from many of you so thanks. I am stuck again. I am really new to this so don't be harsh :-) There are a few problems. You can run the script...
1
by: sam.collett | last post by:
Is there a basic guide on Xml document creation and editing (simpler than the MSDN docs). Say I want to create a file containing the following: <?xml version="1.0" encoding="utf-8"...
2
by: NewBob | last post by:
Since Access automatically highlights all of the text in a text control (I use it to hold data from a memo field) when the control is activated, I've added the following code to put the cursor at...
1
by: pratyush.aditya | last post by:
hi, can anybody tell me what are the steps and procedures that are to be taken for video editing like frame extraction etc from avi,mpeg files using C programming.
0
by: Art Decco | last post by:
For some reason I was under the impression that .Net's RichTextBox supported drag and drop editing, but if it does, I don't see how to turn it on. I'm not talking about dragging files or images...
8
by: Sam Collett | last post by:
Is there a basic guide on Xml document creation and editing (simpler than the MSDN docs). Say I want to create a file containing the following: <?xml version="1.0" encoding="utf-8"...
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
14
by: James | last post by:
I compile my code, I get a few errors, I go to the 1st error in the editor and start to type in the correct code and I get no where because with each key stroke the caret goes away, then a long...
1
by: zivon | last post by:
now for the bigger problam :) I know you pepole hate using OE for sending emails, but its user friendly and its needed in this case... I found on this forum, a code that sends email using OE...
7
by: JeremyWoertink | last post by:
I have an app that I need to make changes to, and on my local copy I have a start.aspx.vb file that I edited and tested, now when I go to the app on the server, it doesn't show any of the .vb...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.