stash Posted March 8, 2005 Author Share 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) ) Link to comment Share on other sites More sharing options...
stash Posted March 8, 2005 Share 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) ) Link to comment Share on other sites More sharing options...
stash Posted March 8, 2005 Author Share 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) ) Link to comment Share on other sites More sharing options...
Newbies basicus Posted April 15, 2005 Newbies Share 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? Link to comment Share on other sites More sharing options...
stash Posted April 18, 2005 Author Share 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) ) Link to comment Share on other sites More sharing options...
Recommended Posts