473,405 Members | 2,210 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,405 software developers and data experts.

Getting tricky with adding text

26
I need to add "FOR IMMEDIATE RELEASE." to all of my records.

I know I can use ConCat, but approximately 75% of my records contain some HTML at the beginning for formatting. I need to add the statement to the Beginning of the text (after </DEV>) or at the beginning of the record, whichever is closer.

So, a record without HMTL will be:
"FOR IMMEDIATE RELEASE.
Private John G dough has graduated......"

And with will be:
"<PHOTO>
FOR IMMEDIATE RELEASE.
Private Gina I Jane has graduated......"

Is there an easy way to say "look for </DEV>" and if not, do it anyways?

The reason is this: I later pull my title from everything after "RELEASE. " and before "HAS GRADUATED"

Thanks!
Tony
Mar 11 '08 #1
4 1337
amitpatel66
2,367 Expert 2GB
I need to add "FOR IMMEDIATE RELEASE." to all of my records.

I know I can use ConCat, but approximately 75% of my records contain some HTML at the beginning for formatting. I need to add the statement to the Beginning of the text (after </DEV>) or at the beginning of the record, whichever is closer.

So, a record without HMTL will be:
"FOR IMMEDIATE RELEASE.
Private John G dough has graduated......"

And with will be:
"<PHOTO>
FOR IMMEDIATE RELEASE.
Private Gina I Jane has graduated......"

Is there an easy way to say "look for </DEV>" and if not, do it anyways?

The reason is this: I later pull my title from everything after "RELEASE. " and before "HAS GRADUATED"

Thanks!
Tony
But in your sample data, you show it as after <PHOTO>?

You want the text to be inserted after <PHOTO> or after </DEV>?
Mar 11 '08 #2
TVining
26
But in your sample data, you show it as after <PHOTO>?

You want the text to be inserted after <PHOTO> or after </DEV>?
</DEV>

sorry. I was using that as an example. <photo> meant that is where the photo appears when the record is displayed.

Tony
Mar 11 '08 #3
amitpatel66
2,367 Expert 2GB
</DEV>

sorry. I was using that as an example. <photo> meant that is where the photo appears when the record is displayed.

Tony
I will suggest you to use two different updates as shown below:

Expand|Select|Wrap|Line Numbers
  1.  
  2. UPDATE table1 SET column1 = CONCAT('FOR IMMEDIATE RELEASE',column1) WHERE INSTR(column1, '</Dev>') = 0
  3. /
  4.  
  5. UPDATE table1 SET column1 = CONCAT(SUBSTRING(column1,1,INSTR(column1,'</DEV>') + 6),' FOR IMMEDIATE RELEASE ',SUBSTRING(column1,INSTR(column1,'</DEV>') + 6)) WHERE INSTR(column1,'</DEV>') > 0
  6. /
  7.  
  8.  
Mar 12 '08 #4
TVining
26
Okay, I get it. Thanks!!
Mar 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Andy | last post by:
Hi, I am complete JavaScript novice and would really appreciate some help with this code: ===================================================================== <%@LANGUAGE="VBSCRIPT"...
2
by: Felipe Gasper | last post by:
I'm trying to make some "sub-cells" in an HTML table and to control their positioning and content presentation via CSS. In the table at the following URL: ...
11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
3
by: ALPO | last post by:
We have a datagrid built using template columns. Many are text boxes. These text boxes are bound to a datasource as follows: <ItemTemplate> <asp:TextBox id="txtPeriod1" runat="server"...
1
by: Jim Corey | last post by:
I have an ASP app that I've recreated in ASP.NET and have a problem recreating one part of it. The original includes a dropdown (an html select object with name='Origin') that I populate using...
3
by: AMD Desktop | last post by:
Hi, I need to add a header to a datagrid. This is the code I am trying to use: Dim dgStaffingReport As New DataGrid Dim dgitem As New DataGridItem(0, 0, ListItemType.Header) Dim mycell...
32
by: paul | last post by:
HI! I keep on getting this error and I have tried different things but I am not sure how to send the expiring date. The error that I am getting in Firefox 1.5 is "Error: expires.toGMTString is...
3
by: rpupkin77 | last post by:
Hey, How does one going about their user's geographical location? Is that even a PHP question. For example, a site may say "Find others near Boston", but if you were in New York, it would say...
5
by: tshad | last post by:
I have the following class in my VS 2008 project that has a namespace of MyFunctions. ********************************* Imports System Imports System.Text.RegularExpressions Namespace...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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,...

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.