stash Posted March 8, 2005 Author Posted March 8, 2005 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) )
stash Posted March 8, 2005 Posted March 8, 2005 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) )
stash Posted March 8, 2005 Author Posted March 8, 2005 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) )
Newbies basicus Posted April 15, 2005 Newbies Posted April 15, 2005 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?
stash Posted April 18, 2005 Author Posted April 18, 2005 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) )
Recommended Posts