Version:4.0.1
Edition:Excel
Effect image
Example code
<SelectRange("A1","Sheet1","Book1.xls")> For(10) $TempValue$=<ReadCell()> $1$=<TextSearch($TempValue$,",")> $2$=<TextSearch($TempValue$,",","nocase",2)> $value$=<TextExtract($TempValue$,$2$)> <MoveColumn("Left",4)>Next |
Code explanation
SelectRange("A1","Sheet1","Book1.xls")>; Select the first cell of the cells need to be processed
For(10); Loop 10 times
$TempValue$=<ReadCell()>; Get the text from the selected cell need to be processed
$1$=<TextSearch($TempValue$,",")>; Get the first position of "," symbol in the text
$value$=<TextExtract($TempValue$,1,$1$)>; Get the characters from the first character to the position of "," symbol in the text
$value$=<TextTrimRight($value$,1)>; Trim a of character from the right hand side of the text to extract.
<MoveColumn("Right",2)>; Move the cursor to right two cells
<WriteCell($value$)>; Write the processed text into the cell selected by cursor
$2$=<TextSearch($TempValue$,",","nocase",2)>; Get the second position of "," symbol in the text
$num$=<Sub($2$,$1$)>; Get the number of characters between the first "," symbol and the second "," symbol in the text
$value$=<TextExtract($TempValue$,$1$,$num$)>; Get $num$ characters from the first position of "," symbol in the text
$value$=<TextExtract($TempValue$,$2$)>; Get the remaining characters from the second position of "," symbol in the text
<MoveColumn("Left",4)>; Move the cursor to left four cells
Related operations
Text search
Text extract
Text trim right
Text trim left