Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2005

Tip: Looking for answers? Try searching our database.

problem replaceall with vba code.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maya - 05 Feb 2005 15:01 GMT
Hi.

I wrote a procedure tha scan tx file, look for specific word  and replace it
by other.
the problem I have is when the replaceable word is shorter than the
original - I got at the end of the file garbage character. That meen if I
had replaced all the apperance of the word 'red' with the word 'yellow'
which were 9 times at the txt file. I would have at the end of the txt file
21 character. If I replace with a longer word the txt file will be O.K.

I don't want to copy it to a new file.

can anyone help me with that bug.?

Thanks.
Andi Mayer - 05 Feb 2005 19:30 GMT
>Hi.
>
[quoted text clipped - 11 lines]
>
>Thanks.

how to you read and write that file?

my guess is that you are using get and put?
or you read fixed length?
---
If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
John Nurick - 06 Feb 2005 06:09 GMT
Hi Maya,

If editing a text file may change its length, the only way to do it is
to read the existing file and create a new one containing the changes.

>Hi.
>
[quoted text clipped - 11 lines]
>
>Thanks.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Maya - 09 Feb 2005 17:33 GMT
I manage with the problem, I copy the new txt file to tmp file, and then
'kill' the old txt file and i rename the tmp txt file to the original
name.not elegant but works....

Thanks, Maya

> Hi Maya,
>
[quoted text clipped - 21 lines]
>
> Please respond in the newgroup and not by email.
John Nurick - 09 Feb 2005 19:00 GMT
That's how all text editing programs work under the covers!

>I manage with the problem, I copy the new txt file to tmp file, and then
>'kill' the old txt file and i rename the tmp txt file to the original
[quoted text clipped - 29 lines]
>>
>> Please respond in the newgroup and not by email.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.