Yet another quiz question
Brett Greiner (Kinetix)
Brett@Kinetix.co.nz
Wed, 25 Aug 2004 10:12:58 +1200
This is a multi-part message in MIME format.
------_=_NextPart_001_01C48A27.831C63D0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi Kristina,
=20
We use the index verb to remove unwanted chars, the index will give the
position of the character ie. ", then use string manipluation to replace
the char.
=20
Technique that we use (code untested)
Eg.=20
=20
; finds the " in the string
define D-S1 num*4 =3D index(DESC,'"')
define D-DESC-1 char*80 =3D DESC[1:D-S1 - 1] + " " + DESC[D-S1 + 1:100]
=20
define D-S2 num*4 =3D index(D-DESC-1, '"')
etc
=20
Hope this helps,
Brett.
=20
-----Original Message-----
From: powerh-l-admin@lists.sowder.com
[mailto:powerh-l-admin@lists.sowder.com] On Behalf Of Kristina Carlton
Sent: Wednesday, 25 August 2004 9:39 a.m.
To: 'powerh-l@lists.sowder.com'
Subject: Yet another quiz question
=09
=09
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.=20
=20
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.
=20
Thanks,
-Kristina
Ext. 2459
=20
------_=_NextPart_001_01C48A27.831C63D0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:o =3D=20
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Message</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3DWord.Document name=3DProgId>
<META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
<META content=3D"Microsoft Word 9" name=3DOriginator><LINK=20
href=3D"cid:filelist.xml@01C489F8.CAEA8B80" rel=3DFile-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-face {
font-family: Century Gothic;
}
@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; }
P.MsoNormal {
FONT-SIZE: 9pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Century Gothic"; =
mso-bidi-font-size: 12.0pt; mso-style-parent: ""; mso-pagination: =
widow-orphan; mso-fareast-font-family: "Times New Roman"; =
mso-bidi-font-family: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 9pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Century Gothic"; =
mso-bidi-font-size: 12.0pt; mso-style-parent: ""; mso-pagination: =
widow-orphan; mso-fareast-font-family: "Times New Roman"; =
mso-bidi-font-family: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 9pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Century Gothic"; =
mso-bidi-font-size: 12.0pt; mso-style-parent: ""; mso-pagination: =
widow-orphan; mso-fareast-font-family: "Times New Roman"; =
mso-bidi-font-family: "Times New Roman"
}
P.MsoAutoSig {
FONT-SIZE: 9pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Century Gothic"; =
mso-bidi-font-size: 12.0pt; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times =
New Roman"
}
LI.MsoAutoSig {
FONT-SIZE: 9pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Century Gothic"; =
mso-bidi-font-size: 12.0pt; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times =
New Roman"
}
DIV.MsoAutoSig {
FONT-SIZE: 9pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Century Gothic"; =
mso-bidi-font-size: 12.0pt; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times =
New Roman"
}
SPAN.EmailStyle15 {
COLOR: #333399; mso-bidi-font-family: Arial; mso-style-type: =
personal-compose; mso-ansi-font-size: 10.0pt; mso-ascii-font-family: =
"Century Gothic"; mso-hansi-font-family: "Century Gothic"
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DEN-US style=3D"tab-interval: .5in">
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
Kristina,</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>We use=20
the index verb to remove unwanted chars, the index will give the =
position=20
of the character ie. ", then use string manipluation to replace the=20
char.</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>Technique that we use (code untested)</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>Eg.=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>;=20
finds the " in the string</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
D-S1 num*4 =3D index(DESC,'"')</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
D-DESC-1 char*80 =3D DESC[1:D-S1 - 1] + " " + DESC[D-S1 +=20
1:100]</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
D-S2 num*4 =3D index(D-DESC-1, '"')</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>etc</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>Hope=20
this helps,</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2>Brett.</FONT></SPAN></DIV>
<DIV><SPAN class=3D526010622-24082004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT=20
face=3DTahoma size=3D2>-----Original Message-----<BR><B>From:</B>=20
powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com] <B>On=20
Behalf Of </B>Kristina Carlton<BR><B>Sent:</B> Wednesday, 25 August =
2004 9:39=20
a.m.<BR><B>To:</B> 'powerh-l@lists.sowder.com'<BR><B>Subject:</B> Yet =
another=20
quiz question<BR><BR></FONT></DIV>
<DIV class=3DSection1>
<P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3D"Century =
Gothic"=20
color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">I am running =
several=20
extracts and outputting the data into a “ delimited file. The =
plan is to=20
upload this data into a Progress database and a double quote is the =
only=20
delimiter I can use. The problem is that some of our character fields =
have a=20
double quote within the data (which shouldn’t be there) and I =
need to parse=20
through each text field, see if it contains any double quotes, and =
replace=20
each with a space. <o:p></o:p></SPAN></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3D"Century =
Gothic"=20
color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt"><![if =
!supportEmptyParas]><![endif]> <o:p></o:p></SPAN></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3D"Century =
Gothic"=20
color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">Is that even =
possible in=20
Quiz? I know how to do it in SQL or Progress, but don’t even =
know where to=20
begin in Quiz.<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3D"Century =
Gothic"=20
color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt"><![if =
!supportEmptyParas]><![endif]> <o:p></o:p></SPAN></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3D"Century =
Gothic"=20
color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: =
12.0pt">Thanks,<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=3DMsoNormal><!--[if supportFields]><font =
color=3D"#333399"><span=20
style=3D'color:#333399'><span =
style=3D'mso-element:field-begin'></span><span=20
style=3D"mso-spacerun: yes"> </span>AUTOTEXTLIST \s "E-mail=20
Signature" <span =
style=3D'mso-element:field-separator'></span></span></font><![endif]--><S=
PAN=20
class=3DEmailStyle15><FONT color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: =
12.0pt">-Kristina<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3D"Century =
Gothic"=20
color=3D#333399 size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">Ext.=20
2459</SPAN></FONT></SPAN><FONT color=3D#333399><SPAN=20
style=3D"COLOR: #333399; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><!--[if supportFields]><font =
color=3D"#333399"><span=20
style=3D'color:#333399'><span =
style=3D'mso-element:field-end'></span></span></font><![endif]--><FONT=20
color=3D#333399><SPAN style=3D"COLOR: #333399"><![if =
!supportEmptyParas]><![endif]> </SPAN></FONT><FONT=20
color=3D#333399><SPAN=20
style=3D"COLOR: #333399; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML=
>
=00
------_=_NextPart_001_01C48A27.831C63D0--