Jump to content
Server Maintenance This Week. ×

This topic is 6949 days old. Please don't post here. Open a new topic instead.

Recommended Posts

This is one simple text parser which I use as a custom function. So, if you have to take one part of the text, set the parameters in Ripper and go on.

Let (

[

$Start = Position(Field; Parameter_From; ""; Occurrence1);

$End = Position(Field; Parameter_To; ""; Occurrence2)

];

Middle(Field; $Start+Start_Correction; $End-$Start-Length_Correction)

)

Link to comment
Share on other sites

This is one simple text parser which I use as a custom function. So, if you have to take one part of the text, set the parameters in Ripper and go on.

Let (

[

$Start = Position(Field; Parameter_From; ""; Occurrence1);

$End = Position(Field; Parameter_To; ""; Occurrence2)

];

Middle(Field; $Start+Start_Correction; $End-$Start-Length_Correction)

)

Link to comment
Share on other sites

This is one simple text parser which I use as a custom function. So, if you have to take one part of the text, set the parameters in Ripper and go on.

Let (

[

$Start = Position(Field; Parameter_From; ""; Occurrence1);

$End = Position(Field; Parameter_To; ""; Occurrence2)

];

Middle(Field; $Start+Start_Correction; $End-$Start-Length_Correction)

)

Link to comment
Share on other sites

  • 1 month later...
  • Newbies

Can this function be used to split a number too?

I need to split a fields contents (100,00) so that newfield 1 holds 100 and newfield 2 holds the 00. So I would use comma as seperator.

Could you set up an exaple here how to do that?

Link to comment
Share on other sites

1.0 To get a hundred adjust Ripper like this:

Let (

[

// ** from first round fence

$Start = Position(Field; "("; ""; 1);

// ** to the first comma separator

$End = Position(Field; ","; ""; 1)

];

/* Start correction plus 1 (otherwise you'll capture left round fence "(" in your result

) and with same reason end correction is -1 (to avoid comma sepratator in end result) */

Middle(Field; $Start+1; $End-$Start-1)

)

2.0 To get zeros:

Let (

[

$Start = Position(Field; ","; ""; 1);

$End = Position(Field; ")"; ""; 1)

];

Middle(Field; $Start+1; $End-$Start-1)

)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.