FW: Yet another quiz question
Pickering, John (NORBORD)
John.Pickering@norbord.com
Tue, 24 Aug 2004 18:16:30 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C48A28.01C79B00
Content-Type: text/plain;
charset="iso-8859-1"
Kristina
It's kind of ugly in Quiz, but doable ...
define d-quote-a int*2 = index(textitem of yourfile,'"')
define d-text-a char*50 &
= text of yourfile if 0 = d-quote-a &
else text of yourfile[1:d-quote-a - 1] + " " + text of yourfile[d-quote-a
+ 1:50]
This puts your text item (textitem of yourfile) into the defined item
d-text-a with one less double quote than it started with. You'll need to
repeat this goofy looking stuff at least as many times as you think there
will be double quotes in your text field. Something like ...
define d-quote-b int*2 = index(d-text-a,'"')
define d-text-b char*50 &
= d-text-a if 0 = d-quote-b &
else d-text-a[1:d-quote-b - 1] + " " + d-text-a[d-quote-b + 1:50]
If you have lots of fields to which this must be applied your Quiz will
become a real cpu pig. Qtp would be a better choice and Quick in batch would
be even better since a loop could be constructed.
Instead of all this struggle, I'd be inclined to create a fixed length
record subfile, define that subfile in Progress and forget about the
delimited file stuff. For a "three and a half" generation language Progress
isn't too bad -- but it can never match PowerHouse.
Regards,
JWP
-----Original Message-----
From: Kristina Carlton [mailto:Kristina.Carlton@JICompanies.com]
Sent: Tuesday, August 24, 2004 5:39 PM
To: 'powerh-l@lists.sowder.com'
Subject: Yet another quiz question
I am running several extracts and outputting the data into a " delimited
file. The plan is to upload this data into a Progress database and a double
quote is the only delimiter I can use. The problem is that some of our
character fields have a double quote within the data (which shouldn't be
there) and I need to parse through each text field, see if it contains any
double quotes, and replace each with a space.
Is that even possible in Quiz? I know how to do it in SQL or Progress, but
don't even know where to begin in Quiz.
Thanks,
-Kristina
Ext. 2459
------_=_NextPart_001_01C48A28.01C79B00
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content=Word.Document name=ProgId>
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK
href="cid:filelist.xml@01C489F8.CAEA8B80" rel=File-List><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:DrawingGridHorizontalSpacing>2.85 pt</w:DrawingGridHorizontalSpacing>
<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
</w:WordDocument>
</xml><![endif]-->
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:"Century Gothic";
panose-1:2 11 5 2 2 2 2 2 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:647 0 0 0 159 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:9.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Century Gothic";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:9.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Century Gothic";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";}
span.EmailStyle15
{mso-style-type:personal-compose;
mso-ansi-font-size:10.0pt;
mso-ascii-font-family:"Century Gothic";
mso-hansi-font-family:"Century Gothic";
mso-bidi-font-family:Arial;
color:#333399;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-US style="tab-interval: .5in">
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff
size=2>Kristina</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>It's
kind of ugly in Quiz, but doable ...</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>define
d-quote-a int*2 = index(textitem of yourfile,'"')</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>define
d-text-a char*50 &</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>
= text of yourfile if 0 = d-quote-a &</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>
else text of yourfile[1:d-quote-a - 1] + " " + text of yourfile[d-quote-a +
1:50]</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>This
puts your text item (textitem of yourfile) into the defined item d-text-a with
one less double quote than it started with. You'll need to repeat this goofy
looking stuff at least as many times as you think there will be double
quotes in your text field. Something like ...</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>define
d-quote-b int*2 = index(d-text-a</FONT></SPAN><SPAN
class=796090322-24082004><FONT face=Arial color=#0000ff
size=2>,'"')</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>define
d-text-b char*50 &</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>
= d-text-a if 0 = d-quote-b &</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff size=2>
else d-text-a[1:d-quote-b - 1] + " " + d-text-a[d-quote-b +
1:50]</FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004>If you have lots of fields to which this
must be applied your Quiz will become a real cpu pig. Qtp would be a better
choice and Quick in batch would be even better since a loop could be
constructed.</SPAN></DIV>
<DIV><SPAN class=796090322-24082004></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004>Instead of all this struggle, I'd be
inclined to create a fixed length record subfile, define that subfile in
Progress and forget about the delimited file stuff. For a "three and a half"
generation language Progress isn't too bad -- but it can never match
PowerHouse.</SPAN></DIV>
<DIV><SPAN class=796090322-24082004></SPAN> </DIV>
<DIV><SPAN class=796090322-24082004>Regards,</SPAN></DIV>
<DIV><SPAN class=796090322-24082004>JWP</SPAN></DIV></FONT></SPAN></DIV>
<DIV><SPAN class=796090322-24082004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Kristina Carlton
[mailto:Kristina.Carlton@JICompanies.com]<BR><B>Sent:</B> Tuesday, August 24,
2004 5:39 PM<BR><B>To:</B> 'powerh-l@lists.sowder.com'<BR><B>Subject:</B> Yet
another quiz question<BR><BR></FONT></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN class=EmailStyle15><FONT face="Century Gothic"
color=#333399 size=2><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">I
am running several extracts and outputting the data into a “ delimited file. The
plan is to upload this data into a Progress database and a double quote is the
only delimiter I can use. The problem is that some of our character fields have
a double quote within the data (which shouldn’t be there) and I need to parse
through each text field, see if it contains any double quotes, and replace each
with a space. <o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN class=EmailStyle15><FONT face="Century Gothic"
color=#333399 size=2><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt"><![if !supportEmptyParas]><![endif]> <o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN class=EmailStyle15><FONT face="Century Gothic"
color=#333399 size=2><SPAN
style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">Is that even possible in
Quiz? I know how to do it in SQL or Progress, but don’t even know where to begin
in Quiz.<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN class=EmailStyle15><FONT face="Century Gothic"
color=#333399 size=2><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt"><![if !supportEmptyParas]><![endif]> <o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN class=EmailStyle15><FONT face="Century Gothic"
color=#333399 size=2><SPAN
style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">Thanks,<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><!--[if supportFields]><font color="#333399"><span
style='color:#333399'><span style='mso-element:field-begin'></span><span
style="mso-spacerun: yes"> </span>AUTOTEXTLIST \s "E-mail
Signature" <span style='mso-element:field-separator'></span></span></font><![endif]--><SPAN
class=EmailStyle15><FONT color=#333399 size=2><SPAN
style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">-Kristina<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN class=EmailStyle15><FONT face="Century Gothic"
color=#333399 size=2><SPAN
style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">Ext.
2459</SPAN></FONT></SPAN><FONT color=#333399><SPAN
style="COLOR: #333399; mso-color-alt: windowtext"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><!--[if supportFields]><font color="#333399"><span
style='color:#333399'><span style='mso-element:field-end'></span></span></font><![endif]--><FONT
color=#333399><SPAN
style="COLOR: #333399"><![if !supportEmptyParas]><![endif]> </SPAN></FONT><FONT
color=#333399><SPAN
style="COLOR: #333399; mso-color-alt: windowtext"><o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML>
------_=_NextPart_001_01C48A28.01C79B00--