I had a similar request, and I used the write action with a series of <@PAD>
tags. As Stefan points out in a separate post to this thread, there is a
gotcha with the number of characters. It took me a little bit to figure it
out as well.

I also wrote a little app to read the exported file and check the position
of certain strings. It was a lot easier than opening the export file in a
text editor and trying to count by hand. I had a form so that I could enter
the string I was checking for, and a page that used the <@LOCATE> tag to
find the position.

Hope this helps,

Steve Smith

Oakbridge Information Solutions
Office: (519) 624-4388
GTA:    (416) 606-3885
Fax:    (519) 624-3353
Cell:   (416) 606-3885
Email:  [EMAIL PROTECTED]
Web:    http://www.oakbridge.ca


> -----Original Message-----
> From: Scott Cadillac [mailto:[EMAIL PROTECTED]
> Sent: March 6, 2003 11:25 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Witango-Talk: Help with Strings
>
>
> Hi Gene,
>
> I shouldn't think it would too hard. If I follow you, you need a
> string of a
> known length - but have to populate the string with some
> particular bits of
> data?
>
> You could prepare a string, like the following, with markers (of known
> length) - then use <@REPLACE> to substitute the markers with your data:
>
> AAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCDDDDDDDDDDDDDDD
>
> .........................
> Legend
> A = User ID
> B = First name
> C = Last name
> D = Title
>
> Another Metatag to use in conjunction with <@REPLACE> would be <@PAD> -
> available in SP1 or higher. Which can provide whatever filler character to
> use around the data.
>
> From the "Whats_new.PDF".
>
> <@PAD>
>
> Syntax <@PAD STR=string NUMCHARS=padToLength [CHAR=padcharacter]
> [POSITION=BEFORE|AFTER] [ENCODING=encoding]>
> Description The <@PAD> meta tag returns an input string expanded to a
> specified length by prefixing or appending a given character as
> many times as necessary. It can be used to construct values to be
> passed to a function that expects fixed length data or to build up a
> table or other preformatted text for display in a monospaced font.
> The STR attribute specifies the string to be padded.
> The NUMCHARS attribute specifies the length to which the string is
> padded. If the specified string to be padded (STR) is longer than the
> length specified in NUMCHARS, the original string is returned.
> The CHAR attribute specifies the character to use to pad the string. If
> more than one character is specified here, only the first character is
> used. If the CHAR attribute is absent, the space character is used to
> pad the string.
> The POSITION attribute is optional, and indicates whether to pad
> the beginning (BEFORE) or end (AFTER) of the string. The default is
> AFTER.
> All attributes of <@PAD> may contain meta tags.
>
> Example <@PAD STR="alpha" CHAR="x" NUMCHARS="8"
> POSITION="after">
>
> This example returns "alphaxxx"; that is "alpha" followed by three
> "x" characters.
>
> Hope this helps. Cheers........
>
> Scott Cadillac,
> Witango.org - http://witango.org
> 403-281-6090 - [EMAIL PROTECTED]
> --
> Information for the Witango Developer Community
> ---------------------
>
> XML-Extranet - http://xml-extra.net
> 403-281-6090 - [EMAIL PROTECTED]
> --
> Well-formed Development (for hire)
> ---------------------
>
>
> ----- Original Message -----
> From: "Wolf, Gene" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 06, 2003 8:53 AM
> Subject: Witango-Talk: Help with Strings
>
>
> > OK, I've just run into somethng that I have not seen before,
> and not seen
> > addressed here. I'm hoping that someone here has come up with something
> > similar.
> >
> > I'm writing a program to interface with an OLD DOS type system. The
> > interface requires a series of import records of exactly 252 bytes in
> > length. In this record specific data items like, employee number, shift,
> > date, etc., have specific columns into which they must be
> placed and have
> > specific lengths.
> >
> > What I'd like to do is create a record of 252 bytes, then
> "substring" into
> > those locations the data for each employee and then write that
> record and
> do
> > the same for the next employee record. Unfortunately substring doesn't
> work
> > this way and I can't figure out how to make this happen. I
> suppose I could
> > build this string field by field, and may be reduced to doing
> that, but I
> > thought there may be a better way.
> >
> > Anyone have any ideas?
> >
> > Sincerely,
> > Gene Wolf
> > Business Systems Analyst
> > DRS Optronics, Inc.
> > 2330 Commerce Park Drive
> > Palm Bay, Florida 32905
> > Phone: 321-309-0685
> > E-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >
> > ________________________________________________________________________
> > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
> >                 with unsubscribe witango-talk in the message body
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>                 with unsubscribe witango-talk in the message body

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to