Re: Splitting a text string into fields



Because it's one field, one calculation. And if he needs to create separate
records from those values, it's easier to split the repeating field during
import.

Bill


"42" <nospam@xxxxxxxxxx> wrote in message
news:MPG.1df4e2bb8418ee46989de3@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Seems a little over thought...

Why not just
p1 = (MiddleWords(myInput,1,1)
p2 = (MiddleWords(myInput,2,1)
p3 = (MiddleWords(myInput,3,1)

I'm not sure I see the point of send it through a repitions construct.

-regards,
Dave


In article <FeWdnZURFZqfpRbenZ2dnUVZ_tKdnZ2d@xxxxxxxxxxx>, wjm@xxxxxxx
says...
> Yes, you can do this.
>
> Given the field myInput(text)
>
> myOutput(calculation, text result, 99 repetitions)=
>
> MiddleWords(Extend(myInput);Get(CalculationRepetitionNumber);1)
>
> Will place each discreet value into a separate repetition.
>
> If you then need to have these repetitions further broken up into
> individual
> fields, you can simply use the GetRepetition function. Example:
>
> p1 (calculation, text result) = GetRepetition ( myOutput; 1)
> p2 (calculation, text result) = GetRepetition ( myOutput; 2)
> p3 (calculation, text result) = GetRepetition ( myOutput; 3)
>
> and so on.
>
> Bill
>
> "Elke Maartens" <take@xxxxxxxxx> wrote in message
> news:291120050339410269%take@xxxxxxxxxxxx
> > Hey gurus, I have a challenge. Well , it's a challenge for me [!] but
> > maybe not for you experts.
> >
> > Input is a text string, containing de facto delineators: such as spaces
> > between words, or markers in a file path, etc.
> >
> > Here's an example. This string
> >
> > i1 3.5 7.5 7460 50
> >
> > needs to be split into fields (p1, p2 ... etc)
> >
> > p1 = i1
> > p2 = 3.5
> > p3 = 7.5
> > p4 = 7460
> > p5 = 50
> >
> > I have no problem writing an 'active' script to do the task, but really
> > I'd like do the whole job with calculations. Partly it's aesthetics,
> > but also because it's faster.
> >
> > My present approach is to split the string into a sequence of separated
> > characters, then have a 'sheepdog script' run along the line and
> > allocate them. That works fine, but it's slow, clunky, and a little
> > unsatisfying! For example, when I recently made a major computer
> > upgrade, I found the increased clockspeed was not reflected in the
> > speed of the script, as (I guess) FMP is working off the disk, carting
> > little bits of data around to do the job, rather than making good use
> > of a faster CPU.
> >
> > Any ideas? Hints? I enjoy a challenge, but I have to admit I'm stuck,
> > and I'd be really grateful for some help ­ even if it is only to put my
> > mind at rest with a negative!
> >
> > TIA
> >
> > Elke
>
>
>


.



Relevant Pages

  • Re: Capturing specific Header Date to GV
    ... They are going into separate tables, so Script before the TextFile Source? ... Bill ...
    (microsoft.public.sqlserver.dts)
  • Re: If my marriage doesnt last...
    ... It still isn't worth the paper it's ... Or consider selling them to a friend with bill of sale so they are someone ... Still best if you have them in a separate location or can get them ... Action Pinball & Amusement, LLC ...
    (rec.games.pinball)
  • Re: [PHP] Structured Code vs. Performance
    ... My first choice is using separate files, but if a file e.g. only contains 20 ... parsing these lines in the existing file. ... will probably have more realworld effect on the speed of your script). ... and placement of extra RAM, faster CPU, faster disks, etc. ...
    (php.general)
  • Re: Bypass queue with Sendmail
    ... When calling sendmail to relay email from a specific script, ... any way that I can have the email bypass the normal queuing methods ... One way, I think, would be to have a separate instance of sendmail with ...
    (comp.mail.sendmail)
  • Re: PyUnit and multiple test scripts
    ... > What I really want is to separate all my tests into 'test' directories ... The script below will do that. ... > directories into one big suite and run it all. ... def findfiles: ...
    (comp.lang.python)