FW: [Bulk] RE: [Bulk] Character replacement

Ken Langendock ken.langendock at rogers.com
Tue May 4 10:19:34 CDT 2010


Oops sorry I forgot to add the rest. I stripped it down too much

Ron, the ELSE handles the pipe in any position after the first character

 

This is QTP code if you haven't figured it out already

Each time the item statement is present, a pipe will be removed. Add as many
as you think you need. I usually place 10 to be safe

 

  DEFINE D-Pipe = INDEX(fieldname OF filename, "|")

 

  TEMP T-Length INITIAL 60

  TEMP T-Record CHARACTER * 60

  ITEM T-Record = fieldname OF filename

  ITEM T-Record = T-Record[2:T-Length] IF T-Record[1:1] = '|' &

               ELSE T-Record[1:D-Pipe -1] + " " + T-Record[D-Pipe +
1:T-Length]

                    IF D-Pipe NE 0 &

               ELSE T-Record

  ITEM T-Record = T-Record[2:T-Length] IF T-Record[1:1] = '|' &

               ELSE T-Record[1:D-Pipe -1] + " " + T-Record[D-Pipe +
1:T-Length]

                    IF D-Pipe NE 0 &

               ELSE T-Record

  ITEM T-Record = T-Record[2:T-Length] IF T-Record[1:1] = '|' &

               ELSE T-Record[1:D-Pipe -1] + " " + T-Record[D-Pipe +
1:T-Length]

                    IF D-Pipe NE 0 &

               ELSE T-Record

  ITEM T-Record = T-Record[2:T-Length] IF T-Record[1:1] = '|' &

               ELSE T-Record[1:D-Pipe -1] + " " + T-Record[D-Pipe +
1:T-Length]

                    IF D-Pipe NE 0 &

               ELSE T-Record

 

 

From: Grace, Ron (Chipping Sodbury) UK [mailto:Ron.Grace at hanson.biz] 
Sent: May 4, 2010 9:51 AM
To: 'Ken at Langendock.com'
Subject: [Bulk] RE: [Bulk] Character replacement

 

Ken,

 

I've just been looking at the code in a bit more detail, won't your code
only check for an occurrence of the "|" in the first character of the item,
or am I reading it wrong.

The character may appear in any of the 60 characters as it's a user text
field

 

  _____  

From: Ken Langendock [mailto:ken.langendock at rogers.com] 
Sent: 04 May 2010 14:10
To: Grace, Ron (Chipping Sodbury) UK; powerh-l at lists.sowder.com
Subject: RE: [Bulk] Character replacement

 

Here is an excerpt from my CSV conversion routine.I haven't compiled it but
it is all here

 

  DEFINE D-Pipe = INDEX(fieldname OF filename, "|")

 

  TEMP T-Record CHARACTER * 60

  ITEM T-Record = fieldname OF filename[2:D-Pipe -1] IF fieldname OF
filename[1:1] = '|' &

               ELSE fieldname OF filename[1:D-Pipe -1] + " " + fieldname OF
filename[D-Pipe +1:60]

                    IF D-Pipe NE 0 &

               ELSE fieldname OF filename

 

 

From: powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com
[mailto:powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com] On
Behalf Of Grace, Ron (Chipping Sodbury) UK
Sent: May 4, 2010 7:15 AM
To: powerh-l at lists.sowder.com
Subject: [Bulk] Character replacement

 

Using Powerhouse on a HP3000

I have three 60 character comment fields that sometimes contain the '|'
character, which causes problems as we use this as a delimiter when
exporting files to an external application. I want to run a search/replace
before the export to replace this character with a space. What's the easiest
way to do this.


------------------------------------------ 
The contents of this message, together with any attachments, are intended
only for the use of the person(s) to which they are addressed and may
contain confidential and/or privileged information. Further, any medical
information herein is confidential and protected by law. It is unlawful for
unauthorized persons to use, review, copy, disclose, or disseminate
confidential medical information. If you are not the intended recipient,
immediately advise the sender and delete this message and any attachments.
Any distribution, or copying of this message, or any attachment, is
prohibited.

  _____  

Each of Hanson Aggregates, Hanson Aggregates UK, Hanson Bath & Portland
Stone, Hanson Construction Projects, Hanson Contracting, Hanson Premix,
Hanson Recycling, Ashbridge Concrete and Supamix is a trading name of Hanson
Quarry Products Europe Limited. Hanson Quarry Products Europe Limited is a
private limited company incorporated in England and Wales with registered
number 00300002 and with registered address Hanson House, 14, Castle Hill,
Maidenhead, Berkshire

Hanson Quarry Products Europe Limited is a member of the HeidelbergCement
Group.

  _____  

This e-mail and any attachment transmitted with it are confidential and are
intended for the named person's use only. The contents of the e-mail may
contain sensitive and private or legally privileged information. If you have
received this e-mail in error, please delete it (and any attachment) from
your system and notify the sender immediately. You should not retain, copy
or print the contents of this e-mail (or any attachment) nor should you,
directly or indirectly, disclose or distribute the contents to anyone.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.814 / Virus Database: 271.1.1/2853 - Release Date: 05/04/10
02:27:00

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.814 / Virus Database: 271.1.1/2853 - Release Date: 05/04/10
02:27:00

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20100504/e248335f/attachment-0001.htm 


More information about the powerh-l mailing list