473,661 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A97 replace question?

MLH
I have memo field containing imported data.
In it are numerous Chr(13) & Chr(13) & Chr$(10)
occurrences. How do I rid my table of all occurrences
of this 3-character string ?

Generally there is only a single occurrence in
the memo field of any record.
Sep 2 '08 #1
5 1540
MLH
One more thing, I'm able to extract the problem records
using this query,,,

SELECT tblNewsPaperWeb sitesWORKINGCOP Y.IDfield,
tblNewsPaperWeb sitesWORKINGCOP Y.SixtyCharsAft erURL
FROM tblNewsPaperWeb sitesWORKINGCOP Y
WHERE (((tblNewsPaper WebsitesWORKING COPY.SixtyChars AfterURL) Like "*"
& Chr$(13) & Chr$(13) & Chr$(10) & "*"));

But I don't know how to chop out those undesireables
that are embedded in mid-string with an update query
strategy. To do it manually will be a lot of work.


Sep 2 '08 #2
you could try

update tblNewsPaperWeb sitesWORKINGCOP Y
set SixtyCharsAfter URL = Replace(SomeFie ld,Chr(13) & Chr(13) &
CHr(10), "")
WHERE (((tblNewsPaper WebsitesWORKING COPY.SixtyChars AfterURL) Like "*"
& Chr$(13) & Chr$(13) & Chr$(10) & "*"));

but this wont work if you dont have access 2000 or later

Regards
Kelvan
---------------------
Nothing's Impossible; merely Improbable.
Sep 2 '08 #3
you could try

update tblNewsPaperWeb sitesWORKINGCOP Y
set SixtyCharsAfter URL = Replace(SixtyCh arsAfterURL ,Chr(13) & Chr(13)
&
CHr(10), "")
WHERE (((tblNewsPaper WebsitesWORKING COPY.SixtyChars AfterURL) Like "*"
& Chr$(13) & Chr$(13) & Chr$(10) & "*"));
but this wont work if you dont have access 2000 or later
Regards
Kelvan
---------------------
Nothing's Impossible; merely Improbable.

Sep 2 '08 #4
You can, of course, use user-defined functions (aka UDFs) in Queries, just
as you can use the built-in Replace function in Access 2000 and later
versions. There is an implementation of replacing a string within a string
at http://www.mvps.org/access/strings/str0004.htm. The title indicates that
it is for replacing a character, but, in fact, it replaces a string of
whatever length you desire. If that doesn't work for you, using Google
Groups to search the archives should turn up many implementations of Replace
functions that people used prior to the Replace built-in function being
available in Access 2000.

Just for the record, http://www.mvps.org/access does not have everything
about Access, but it is a more-than-reasonable place to start looking,
because it has so much that is so useful.

Larry Linson
Microsoft Office Access MVP
"MLH" <CR**@NorthStat e.netwrote in message
news:qk******** *************** *********@4ax.c om...
>I have memo field containing imported data.
In it are numerous Chr(13) & Chr(13) & Chr$(10)
occurrences. How do I rid my table of all occurrences
of this 3-character string ?

Generally there is only a single occurrence in
the memo field of any record.

Sep 2 '08 #5
MLH
Thanks, guys. What I ended up doing was not elegant.
But it was effective. I found the InStr point at which the
undesired string began. Knowing it was 3-chars in length,
I was able to concat Left$ and Right$ - extracting the parts
I wanted and leaving the undesirable out-a-the picture.

Once I got a column of values, I just copied 'em 'n pasted
'em over the crappie values. That did the trick. Thx. I'll look
into your suggestions for future reference.

Sep 3 '08 #6

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

Similar topics

19
8693
by: Westcoast Sheri | last post by:
To keep track of how many fruits my visitors buy, I use a mySQL database (2 columns: "fruit" and "quantity")....so can we make these following mySQL queries work somehow? (visitor buys 5 apples): replace into fruit_database set fruit = 'apple' , quantity = quantity + 5; (visitor buys 7 apples): replace into fruit_database set fruit = 'apple' , quantity = quantity +
5
2515
by: Roose | last post by:
How can I do a "".replace operation which tells me if anything was actually replaced? Right now I am doing something like: if searchTerm in text: text = text.replace( searchTerm, 'other' ) But to me this seems inefficient since the 'in' operation will search through the whole string, and then the 'replace' will as well.
19
2926
by: rbt | last post by:
Here's the scenario: You have many hundred gigabytes of data... possible even a terabyte or two. Within this data, you have private, sensitive information (US social security numbers) about your company's clients. Your company has generated its own unique ID numbers to replace the social security numbers. Now, management would like the IT guys to go thru the old data and replace as many SSNs with the new ID numbers as possible. You...
4
62095
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I supposed to write this function? String.replace(/</g,'&lt;');
3
5447
by: Andy Sutorius | last post by:
Hi, I read the thread (2/16/05) regarding a replace function in C# however it didn't answer my question. I have a string which is building an insert sql statement and I would like to replace apostrophes of the form fields. I was trying to do something like this: string sqlInsertEmails = "insert into tblContent (content, subject) values ('" + Replace(txtBody.Text,"'","''") + "', '" + Replace(txtSubject.Text,"'","''") + "')";
9
9145
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a StringBuilder. At present I am porting a VB6 webclass app to VB.NET and therefore I am trying to make it as efficent as possible via the new functionality of VB.NET.
5
2435
by: djc | last post by:
I need to prepare a large text database field to display in an asp.net repeater control. Currently I am replacing all chr(13)'s with a "<br/>" and it works fine. However, now I also want to be able to replace TAB's with "&nbsp;"'s to preserve the user's indentation. My questions are: 1) even though I'll probably look it up before I get a reply.... whats the vb code for TAB character? 2) more importantly; do I have to run this large field...
8
17506
by: Joe Cool | last post by:
I need to map several columns of data from one database to another where the data contains multiple spaces (once occurance of a variable number or spaces) that I need to replace with a single space. What would be the most efficient way to do this? I am using SQL2K. I was thinking a function since I know of no single Transact-SQL command that can accomplish this task.
6
1730
by: alainfri | last post by:
I am not sure if this group is the right place for this question but what I need is as follows. There is a piece of html. Throughout the html there are a lot of <brtags. The task is to replace all these <brtags with \n\r. The replacement must be performed only within <preblocks. I can do this using VBScript in the following way: Option Explicit
15
1893
by: =?Utf-8?B?TWlrZSAiWU9fQkVFIiBC?= | last post by:
I have a text file that contains about 8 to 10 text sequences that I need to replace. I want to search and replace all 8 to 10 text sequence anytime I run this script Here is what I have so far. Const ForReading = 1 Const ForWriting = 2
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.