Actions

Difference between revisions of "%scutf"

From Zenitel Wiki

 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{A}}  
+
{{AI}}  
 
[[Event_Handler]] macro - Extract substring by field, fields defined by delimiter character.
 
[[Event_Handler]] macro - Extract substring by field, fields defined by delimiter character.
  
Line 6: Line 6:
 
*''delimiter'' is a single char, possibly escaped. Optionally followed by + sign to indicate that more than one delimiter character is allowed between fields.
 
*''delimiter'' is a single char, possibly escaped. Optionally followed by + sign to indicate that more than one delimiter character is allowed between fields.
 
*''field-no'' is a integer number, counting starts from zero!
 
*''field-no'' is a integer number, counting starts from zero!
*Example of escaped delimiters : Tab= \t  ‘,’ = \,
+
*Example of escaped delimiters : Tab = \t  Comma = \,
 
*Useful for parsing [[External_Data_Input]].
 
*Useful for parsing [[External_Data_Input]].
  
 
Examples:
 
Examples:
 +
%scutf(%edi,;,0) ''extract the first field, number 0; fields separated by semicolon (Fields start at zero!)''
 +
 +
%scutf(%edi, ,1) ''extract the second field, number 1; fields separated by a space''
 +
 
  %scutf(%edi, +,3) ''extract field number 3; fields separated by any number of spaces''
 
  %scutf(%edi, +,3) ''extract field number 3; fields separated by any number of spaces''
 +
 +
''%scutf(%edi,_,3) extract field number 3; fields separated by underscore''
 +
 +
''%scutf(%edi,\t,3) extract field number 3; fields separated by TAB''
 +
 
  %scutf(%edi,\,,3) ''extract field number 3; fields separated by commas''
 
  %scutf(%edi,\,,3) ''extract field number 3; fields separated by commas''
  

Latest revision as of 23:48, 15 February 2021

AI.png

Event_Handler macro - Extract substring by field, fields defined by delimiter character.

Format: scutf(string, delimiter, field-no)

  • delimiter is a single char, possibly escaped. Optionally followed by + sign to indicate that more than one delimiter character is allowed between fields.
  • field-no is a integer number, counting starts from zero!
  • Example of escaped delimiters : Tab = \t Comma = \,
  • Useful for parsing External_Data_Input.

Examples:

%scutf(%edi,;,0) extract the first field, number 0; fields separated by semicolon (Fields start at zero!)
%scutf(%edi, ,1) extract the second field, number 1; fields separated by a space
%scutf(%edi, +,3) extract field number 3; fields separated by any number of spaces
%scutf(%edi,_,3) extract field number 3; fields separated by underscore
%scutf(%edi,\t,3) extract field number 3; fields separated by TAB
%scutf(%edi,\,,3) extract field number 3; fields separated by commas


Back to Event_Handler#List_of_macros.