473,699 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Removing Carriage Returns

Hi All,

I am trying to remove carriage returns from a text field via some code.

Here is an example of what I am up against.

The field streetname contains the little square box that I believe is a
carriage return.

So, the field will have text, the little square box and more text. I
am trying to remove whatever that little box is. I tried to paste it
into this but it just moved the latter text to a new line, hence the
carriage return.

Any help would be appreciated.

Thanks

Jun 8 '06 #1
3 26329
if string s contains your address, one of the following will do the trick:

(most likely case first)

s = replace(s, vbcrlf, ", ") 'if it's a CR/LF pair, you'll
get a comma instead

or

s = replace (s, chr(10), ", " 'if it's just a Line Feed, you get a
comma instead

or

s = replace (s, chr(13), ", " 'if it's just a Carraige Return, you
get a comma instead
Jun 8 '06 #2
Rick,

Thanks so much and I definitely was making that much more difficult
than it needed to be.

It was the 2nd one that did the trick.

Thanks Again,

Jun 8 '06 #3
Great.

By the way, there are constants for those other things. I just forgot about
them? vbCr and vbLf are chr(13) and chr(10) respectively.
Jun 8 '06 #4

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

Similar topics

1
4717
by: Augustus | last post by:
Hiya, I have a form with a <textarea></textarea> to receive user input. This input is then stored in a database and sent by fax... I need to be able to remove the carriage returns (enter key... vbcrlf...) from the input so that somebody doesn't do something like fill the textarea with 100s of keypresses of the enter key and end up spitting out tonnes of blank pages on the fax machine
4
7315
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to use: 'replace carriage returns with BRs comment=Replace(comment, chr(13), "<br>") but obviously net.! The <pre> tag doesn't sem to help either as the embedded return is
3
2204
by: JMCN | last post by:
does anyone know how to take out {enter} strings from a field? for instance, i have: "INTWEST ADJUSTMENT ORG ILLINOIS FUND PARTICIPANT DIVIDEND". i managed to take out extra spaces but then it comes to {enter} and {tab} i cannot parse them out. thanks!! jung
2
2335
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost when pulling data from an SQL database. The thing that frustrates me the most, is that when I use Enterprise Manager, the carriage returns ARE THERE. It looks fine until I pull it out.
8
2221
by: TheDude5B | last post by:
Hi, I have some data which is stored in my MySQL database as TEXT. when the data is entered in, it has some carriage returns in it, and this can be seen when querying the data using MySQL Query Browser. I want to then display this text within <p> tags when requested from the database. However, the test is formatted without the carriage returns.
7
11190
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the comment through a pop-up that contains a textarea. When the user hits OK on the pop-up, the text in the textarea is sent to a function on the main page. The function inserts the text into the div's text node. Please don't ask why I'm making this...
1
2333
by: cgillett76 | last post by:
Hello, I'm using InfoPath to write data to a accessvdatabase. Once the form has been submitted a VB script runs to create a text file to input to another application. Some of the fields contain carriage returns and I need these replaced by /n. Sub LogChangesV2() Dim qdf As DAO.QueryDef Dim db As DAO.Database Dim rst As DAO.Recordset
0
1484
by: markus.shure | last post by:
Hi, I'm noticed a problem testing a JAX-WS client with a WSE server. The JAX-WS client adds carriage returns to a SOAP header element that is signed. This causes the WSE server to raise an error: "The signature or decryption failed". If the carriage returns are removed, the same web service call is successful. I tried replicating the situation with a WSE client. I created a WSE client that adds a SOAP header element that contains a...
2
7431
by: Shrutisinha | last post by:
Hi guys I am trying to remove carriage return /space in perl from my file using this function : $record =~ s/+/ /g; OR chomp($record); nothing is working , can anybody help me please with this
0
8613
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
9172
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
9032
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...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
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
7745
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...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
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();...
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.