Find And Replace Data In Text Object Follow

0
Avatar
Legacy Poster

HI All

 

I have a text object that contains over 60 fields.  Each field contains a string such as "56% Fibre".  I would like to do a Seach and Replace on the Text Object rather than use the transform on each field.

 

Is there a way to do this?

 

I have tried using the "Replace" Function but I cant seem to get it to work.

 

Any guidance would be appreciated.

 

Regards

Nicky

5 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

Neither I can find the way - search and replace only works within the same data source(field). It looks you need to modify each data source, though that could be a bit tedious. 

0
Avatar
Legacy Poster
Comment actions Permalink

In the end I kind of found a way ..... I created a string of all the fields in a vb script and did a transform search and replace on that.  

 

Doing this worked but created a new problem in that I could not suppress a field if it contained no data and as each field was separated by a line feed I ended up with a number of empty rows.

 

Any ideas on how to get rid of all the empty rows?

 

Regards

Nicky

0
Avatar
Shotaro Ito
Comment actions Permalink

Great idea!

If the line feeds are separated data source, you can suppress the data source depends on previous data source is empty or not, from Suppression Transform.

0
Avatar
Legacy Poster
Comment actions Permalink

Hi,

 

Would anyone be able to help with how to insert a hyphen in the value generated from a VB script of HEX (hexadecimal)? For example, HEX(1772) = 6EC. Goal: insert hyphen between 6&E, thus "6-EC". I've tried VB script ----> Value = Replace(Hex(Field("ttimfc010101.t_mser")),2,0,"-"), but received script error <Line 6: Type mismatch: [string: "-"]>. Also, Padding does not work after on VB Script value. Any tips will be appreciated. Thanks.

0
Avatar
Shotaro Ito
Comment actions Permalink

Would this help?

h=Hex(1772)
value = left(h,1) & "-" & mid(h,2,2)

Instead of VB script, there's data source Transform called Character template.

(in data source > Transform tab > Character template)

Tto make XXX to X-XX, template will be ?-??.

 

Please sign in to leave a comment.