Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing various text with ""

Status
Not open for further replies.

smilbert

IS-IT--Management
Aug 28, 2006
36
US
I've migrated legacy data from one system into another (MSSQL). When the data was migrated from MS Word, information was captured from the headers and footers, and now exist in the actual text.

I'd like to write a Crystal formula that will 'strip' these strings out. I can use the Replace formula to get rid of ONE of them, but is there any way to REPLACE more than one string at a time?

The strings include spaces, text, tabs and carriage returns.

I'd also like to replace more than 3 carriage returns in a row with 2.

Any help is appreciated!

I'm using Crystal XI, but the system uses only Crystal 9.x. So far, I've not had trouble importing my reports into the system.
 
You can nest the replace function, so you could try something like:

replace(replace({table.string},chr(13)+chr(13)+chr(13),chr(13)+chr(13)),"texttoeliminate","")

-LB
 
To include replacing tabs use:

replace(replace(replace({table.string},chr(13)+chr(13)+chr(13),chr(13)+chr(13)),"texttoeliminate",""),chr(9)," ")

You can do the same thing globally to the SQL server field, but post back the data type for the field first if you need help there.

A post in the SQL Server forum should resolve it permanently.

-k
 
The DataType in SQL is Memo (is that what you were looking for?)
 
I suggest that you post in SQL Server to build out a script to replace the problems in the memo field.

That way you won't have to invest all of this time correcting the data every time a process needs to use it.

SHould be simple enough, however the above will get you by for now.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top