命令手册?

在这里查询各种命令、辅助功能和运行选项

流程命令?

这里是 TagUI 命令列表。

鼠标和键盘命令?

click 单击?

鼠标左键点击目标
可以使用 DOM, XPath, Point, Image 进行目标定位。
click [DOM/XPath/Point/Image]

例子:

click Main concepts
click //nav/div/div[2]/ul/li[4]/ul/li[1]/a
click (500,200)
click button.png

rclick 右键单击?

鼠标右键单击目标
可以用 DOM, XPath, Point, Image 进行目标定位。
rclick [DOM/XPath/Point/Image]

参考 click 例子。

dclick 双击?

鼠标左键双击目标
可以用 DOM, XPath, Point, Image 进行目标定位。
dclick [DOM/XPath/Point/Image]

参考 click 例子。

hover 鼠标移动?

鼠标移动到目标位置
可以用 DOM, XPath, Point, Image 进行目标定位。
hover [DOM/XPath/Point/Image]

参考 click 例子。

type 输入?

Web输入命令,可以使用 [clear] 清除字段和 [enter] 来点击ENTER键。
可以用 DOM, XPath, Point, Image 进行目标定位。
type [DOM/XPath/Point/Image] as [text to type]

例子:

type search-term as John Wick
type //input[@name="search"] as John Wick
type (500,200) as John Wick
type input_field.png as John Wick

type search-term as [clear]John Wick[enter]
type //input[@name="search"] as [clear]John Wick[enter]
type (500,200) as [clear]John Wick[enter]
type input_field.png as [clear]John Wick[enter]

keyboard 按键/按组合键?

模拟键盘按键

keyboard [keys]

可以使用以下这些功能按键:

  • [shift] [ctrl] [alt] [win] [cmd] [enter]
  • [space] [tab] [esc] [backspace] [delete] [clear]
  • [up] [down] [left] [right] [pageup] [pagedown]
  • [home] [end] [insert] [f1] .. [f15]
  • [printscreen] [scrolllock] [pause] [capslock] [numlock]

例子:

keyboard [win]run[enter]
keyboard [printscreen]
keyboard [ctrl]c
keyboard [tab][tab][tab][enter]

keyboard [cmd][space]
keyboard safari[enter]
keyboard [cmd]c

mouse 鼠标?

在当前鼠标位置,按下鼠标左键/弹起鼠标左键。
mouse down
mouse up

Web 网页端命令?

visit 打开网站/url?

直接输入网址url(带上 http),TagUI 就会在 Chrome 打开这个 URL。

[URL]

例子:

https://google.com

select 下拉选择?

修改下拉选择框,注意 as 后面是区分大小写的。
可以用 DOM, XPath 进行目标定位。
select [DOM/XPath of select input element] as [option value or text]

例子:

select variant as blue

table 保存表格数据?

将Table表格数据保存到CSV文件,基于网页的Table编号或其XPath 进行目标定位。

table [table number] to [filename.csv]
table [XPath] to [filename.csv]

例子:

table 1 to regional_exchange_rates.csv
table (//table)[2] to global_exchange_rates.csv
table //table[@name='report'] to report.csv

frame 针对某些框架操作?

指定下一步操作的目标框架范围。

frame [frame name]
  [steps]

frame [frame name] | [subframe name]
  [steps]

例子:

frame navigation
  click Products

frame main | register
  click Register

download to?

指定 Chrome 下载文件的存储位置。默认位置是当前TagUI流程的文件夹。Specifies a location to store file downloads. The default location is the folder of the TagUI flow.
download to [folder location]
默认情况下 TagUI 启动后 Chrome 不询问下载存放路径,你可以在.tag 文件里增加下面这句,让 Chrome 在下载是询问下载文件存放目录。
js chrome_step('Page.setDownloadBehavior',{behavior: 'default', downloadPath: location})

upload?

上传文件到网站。
仅支持 DOM 目标定位方式。
upload [DOM of upload element] as [filename]

例子:

upload #element_id as report.csv

api?

调用Web API,并将返回内容保存到变量 api_result

如果 API 返回的是JSON数据格式,将自动创建 api_json

api https://some-api-url

例子:

api https://api.github.com/repos/kelaberetiv/TagUI/releases
echo `api_result`
author = api_json[0].author.login

高级 API 示例,设置 POST/GET 方法,看这个例子 from aito.ai 这是一个基于Web的机器学习解决方案。在这个例子中,TagUI 用 api 向 aito.AI 提交数据。

Excel?

请先设置 “使用utf-8 提供全球语言支持”,以便更好的支持 Excel 的中文内容

设置方法:https://gitee.com/TagUIcn/tagui/issues/I57TMU

对 Excel 执行读取,写入,复制,删除 等操作,比如 [workbook]sheet!range 范围。 本功能适用于 Windows 和 Mac 的 Excel 程序。对于部分需要密码的Excel处理,请看这里,需要用到 excel_password = 'password'

variables 变量?

您可以在Excel语法中使用变量,例如范围或表格 range or sheet。TagUI 支持各种版本的 Excel 文件,必须把文件的.扩展名 作为语法的一部分,以便 TagUI 可以识别指令是Excel命令而不是一些JavaScript 代码。

[`workbook`.xlsx]`sheet`!`range` = 123
data = [`workbook`.xlsx]`sheet`!`range`

visibility 是否让Excel操作可见?

默认情况下,Excel 操作将在后台打开并运行,您看不到后台的 Excel 操作。如果您希望在 Excel 显示状态下操作,您可以在流程中使用 excel_focus = true。使用 excel_focus = false 在您的工作流程中再次将其设置为OFF。

For some usage scenarios, you might not even want the Excel app to be visible in the background. In that case, you can set excel_visible = false in your workflow to run Excel invisibly. Use excel_visible = true to make Excel visible again in your RPA workflow.

读取Excel?

从Excel文件读取数据,支持的相对路径和绝对文件路径。如果指定的文件或工作表不存在,则会显示错误。接着,可以指定单元格或某个范围。

variable = [workbook]sheet!range

读取 列column 和 行row 可以使用标准Excel语法范围描述方式,例如: A:A (column A), B:D (columns B to D), 2:2 (row 2), 3:5 (rows 3 to 5)。如果不指定范围,则默认对全部范围进行操作。

例子:

top_profit = [Monthly Report.xlsx]August!E10
top_salesman = [Monthly Report.xlsx]August!E11
data_array = [Quarterly Metrics.xlsx]Main!B3:G100
data_array = [C:\Reports\June.xls]Sheet1!A1:C2

data_array = [C:\Reports\June.xls]Sheet1!A:A
data_array = [C:\Reports\June.xls]Sheet1!B:D
data_array = [C:\Reports\June.xls]Sheet1!2:2
data_array = [C:\Reports\June.xls]Sheet1!3:5

Tagui 的后端语言是JavaScript,因此 Data_array 可以像 JavaScript 数组一样使用。

// to work on data in data_array cell by cell
for row from 0 to data_array.length-1
  for col from 0 to data_array[row].length-1
    echo `data_array[row][col]`

注意 - 读取多行和列有一个限制,举例: B:D and 3:5 (data array returned will be a 1 x N array instead of the correct row x column array)。这个问题在 v6.87 中已经修复。使用 tagui update 命令升级,或者用 MS Word Plug-in Update TagUI 按钮升级。

写入Excel?

使用 Write 命令往Excel内写数据。支持相对和绝对文件路径。如果指定的文件不存在,将创建一个新文件。如果表单不存在,将创建新表。 If the data is an array, the given cell will be used as the top-left cell to write the range of cells.

[workbook]sheet!cell = variable

例子:

[Monthly Report.xlsx]August!E10 = 12345
[Monthly Report.xlsx]August!E11 = "Alan"
[Monthly Report.xlsx]August!E12 = variable
[Quarterly Metrics.xlsx]Main!B3 = data_array

Tagui 的后端语言是JavaScript,因此 Data_array 可以像 JavaScript 数组一样使用。

// to assign a set of range data with 2 rows of 3 columns
[C:\Reports\June.xls]Sheet1!A1 = [[1, 2, 3], [4, 5, 6]]
[C:\Reports\June.xls]Sheet1!A1 = [[variable_1, variable_2, variable_3], [4, 5, 6]]

// example spreadsheet data with #, name and country
[Participants.xlsx]Sheet1!A1 = [['1', 'John', 'USA'], [2, 'Jenny', 'Russia'], [3, 'Javier', 'Serbia']]

// get the next row count for the example spreadsheet
column_A = [Participants.xlsx]Sheet1!A:A
next_row = column_A.length + 1

// write a new row accordingly to example spreadsheet
[Participants.xlsx]Sheet1!A`next_row` = [[next_row, 'Janice', 'Brazil']]

copy 复制?

在Excel文件中复制数据。支持相对和绝对文件路径。如果指定的文件不存在,将创建一个新文件。如果Sheet不存在,将创建新Sheet。 If the data is an array, the given cell will be used as the top-left cell to write the range of cells.

[workbook]sheet!cell = [workbook]sheet!range

例子:

[Monthly Report.xlsx]August!A1 = [Jennifer Report.xlsx]August!A1
[Monthly Report.xlsx]August!A1 = [Jennifer Report.xlsx]August!A1:E200

delete 删除?

删除 Excel 内的数据。支持相对和绝对文件路径。如果指定的文件或工作表不存在,将显示错误。Delete a range of cells by assigning an empty array to it.

[workbook]sheet!cell = ""

例子:

[Monthly Report.xlsx]August!E10 = ""
[Quarterly Metrics.xlsx]Main!A1 = [["", "", ""], ["", "", ""]]

Word?

您可以把 word 文件名分配给变量,来读取Microsoft Word文档的文本内容。TagUI will automate Microsoft Word to copy out the text contents and assign to the variable. 请注意,您需要在计算机上先安装好 Microsoft Word。 此功能适用于 Windows 和 Mac 系统。

Windows 设置word文件路径举例:

word_text = [Research Report.docx]
word_text = [C:\Users\Jennifer\Desktop\Report.docx]
word_text = [FY2021 Reports\Research Report.docx]

filename = 'C:\\Users\\Jennifer\\Desktop\\Report'
word_text = [`filename`.docx]
filename = 'Research Report'
word_text = [`filename`.docx]

Mac 设置word文件路径举例:

word_text = [Research Report.docx]
word_text = [/Users/jennifer/Desktop/Report.docx]
word_text = [FY2021 Reports/Research Report.docx]

filename = '/Users/jennifer/Desktop/Report'
word_text = [`filename`.docx]
filename = 'Research Report'
word_text = [`filename`.docx]

将文本内容读入变量后,您可以使用Tagui的函数来处理它,例如 get_text() 和 del_chars(),以获得RPA流程所需的特定信息。标准JavaScript函数也可用于进行字符串处理,可以 Google 搜索 javascript how to xxxx。 从 Word 读取文本内容后,TagUI 将关闭 Microsoft Word 并继续执行接下去的流程。

PDF?

您只需要将文件名分配给变量,就可以将PDF文件的文本内容赋值给变量。TagUI 将自动执行 PDF Viewer 应用程序以复制文本内容并分配给变量。在 Windows 系统, 你需要安装免费的pdf查看器 Adobe Acrobat Reader,并且设置为打开pdf的默认程序。在Mac 系统, TagUI 使用可以查看PDF文件的默认预览应用程序。

Windows 设置pdf文件路径举例:

pdf_text = [Research Report.pdf]
pdf_text = [C:\Users\Jennifer\Desktop\Report.pdf]
pdf_text = [FY2021 Reports\Research Report.pdf]

filename = 'C:\\Users\\Jennifer\\Desktop\\Report'
pdf_text = [`filename`.pdf]
filename = 'Research Report'
pdf_text = [`filename`.pdf]

Mac 设置pdf文件路径举例:

pdf_text = [Research Report.pdf]
pdf_text = [/Users/jennifer/Desktop/Report.pdf]
pdf_text = [FY2021 Reports/Research Report.pdf]

filename = '/Users/jennifer/Desktop/Report'
pdf_text = [`filename`.pdf]
filename = 'Research Report'
pdf_text = [`filename`.pdf]

将文本内容读入变量后,您可以使用 Tagui 的函数 get_text() 和 del_chars() 来获得RPA流程所需的特定信息。标准JavaScript函数也可用于进行字符串处理,具体可以 Google 搜索javascript how to xxxx。从PDF文件读取文本内容后,TagUI将关闭PDF查看器并继续使用其余自动化步骤。

Using variables 使用变量?

read 读取目标内容放入变量?

获取一些文本或值并将其存储在变量中。
您可以使用 DOM, XPath, Region, Image 进行目标定位。
read [DOM/XPath/Region/Image] to [variable]

当您提供区 域Region 或 图像Image 元素特征时,Tagui 会使用OCR从屏幕中读取字符。

例子:

read //p[@id="address"] to address

read //p[@id="address"]/@class to address-class

read (500,200)-(600,400) to id-number

read frame.png to email

变量赋值?

将文本保存到变量。

[variable] = [value]
在值中使用文本时,请围绕引号中的文本,如 "某些文本"。这使用 JavaScript 的规则,因此您可以将数字分配给变量或使用其他 JavaScript 函数。变量名称需要是一个单词,不能以数字开头。

例子:

count = 5
username = "johncleese"
fullname = firstname + lastname

File saving/loading 文件保存和读取?

dump 文本保存到文件?

将文本保存到新文件,例如把一个文本变量,保存到一个txt里。

dump [text] to [filename]
dump [`variable`] to [filename]
// creates blank CSV file with header
dump First Name,Last Name to names.csv

write 追加写入?

将新的文本保存到现有文件中。

write [text] to [filename]
write [`variable`] to [filename]

例子:

write firstname,lastname to names.csv
write `fullreport` to report.txt

load 读取?

将文件内容加载到变量。

load [filename] to [variable]

例子:

load report.txt to report

snap 截屏?

屏幕截图功能,可以是全屏、某个元素或区域。
使用 DOM, XPath, Region, Image 进行目标定位。
snap [DOM/XPath/Region/Image/page] to [filename]

如果您使用 page 定位目标,会把整个网页进行截图。

例子:

snap logo to logo.png

snap page to webpage.png

显示输出?

echo 信息输出?

在命令行上显示输出内容,比如显示变量。

echo [text]
echo [`variable`]

例子:

echo Flow has started
echo The user is `username`

show 显示元素文本?

在命令行上直接显示元素文本。
可以用 DOM, XPath 进行目标定位。
show [DOM/XPath]

例子:

show review-text

check 根据条件显示文本?

基于条件显示不同文本信息。

check [条件] | [结果为 true 的文本] | [结果为 false 的文本]

例子:

check header_home_text equals to "Home" | "header text is correct" | "header text is wrong"

Custom code 自定义代码?

js?

运行 JavaScript 代码。TagUI 直接访问 JavaScript 变量。

TagUI 可以“智能”判断以下 3 种情况使用,无需使用js或js begin/ js finish:

1. 分配或改变变量 分配变量时,TagUI 可以检测=符号并自动将该行视为 JavaScript 代码。

2.以 ; 结尾:如果一行以 ; 字符结尾,并且该行无法匹配任何已知的 TagUI 命令,则将其视为 JavaScript 代码。

3.常见的JavaScript关键字开头:如果一行无法匹配任何已知的 TagUI 命令,并且该行以常见的 JavaScript 关键字(例如 if、for、switch、else、while、case、break、continue 等)开头,它将自动被视为 JavaScript 代码。

具体了解:https://github.com/kelaberetiv/TagUI/issues/1211

js [JavaScript statement]

js begin
[JavaScript statements]
js finish

例子:

js obj = JSON.parse(api_result)
dump `obj` to result.json

js begin
obj = JSON.parse(api_result)
randomInteger = Math.floor(Math.random() * Math.floor(5)) + 1
js finish
dump `obj` to result.json

// declare and initilise variable to use it inside/outside js code block
a = ""
js begin
a = "some string"
js finish
echo `a`

py?

运行Python代码并将stdout 保存到变量 py_result 作为字符串。

py [Python statement]

py begin
[Python statements]
py finish

例子:

py result = 2 + 3
py print(result)
echo `py_result`

py begin
import random
random_integer = random.randint(1,6)
print(random_integer)
py finish
echo `py_result`

有关运行Python代码的更多示例和使用模式 请参考这里

run?

在命令提示符或终端中运行命令,并将 stdout 保存到变量 run_result

run [shell command]

例子:

run cmd /c mkdir new_directory

vision?

运行 Sikuli 代码,例如你需要把OCR设置成中文

vision begin
import org.sikuli.script.TextRecognizer as TR
Settings.OcrReadText = True
Settings.OcrLanguage = "chi_sim"
TR.reset()
vision finish

例子:

vision click("button1.png")

dom?

在浏览器 DOM 中运行代码并将返回值保存到变量 dom_result

dom [JavaScript statement to run in the DOM]

dom begin
[JavaScript statements to run in the DOM]
dom finish

例子:

// goes back to previous page
dom window.history.back()

// returns text of an element
dom return document.querySelector('#some_id').textContent

r?

运行 R 语句并将 stdout 保存到变量 r_result

r [R statement]

r begin
[R statements]
r finish

更多命令?

wait 等待?

等待一段时间,默认时间单位:秒。

wait [seconds to wait]
wait [seconds to wait] s
wait [seconds to wait] seconds

例子:

wait 5.5
wait 10 s
wait 20 seconds

timeout 设置等待超时?

等待 Web 元素出现时,设置自动等待超时(默认为10秒)。

timeout [seconds to wait before timeout]

例子:

timeout 300

ask?

提示用户输入,并将用户输入内容保存为变量 ask_result

ask [prompt]

例子:

ask What is the date of the receipt? (in DD-MM-YYYY)
type search as `ask_result`

live?

一步步执行命令并立即看到输出。输入 "done" 退出Live模式。

live

tagui 调用流程?

调用另一个 TagUI 流程,注意文件路径别写错。

tagui [flow file]
tagui [folder/flow file]

例子:

tagui update-forex.tag
tagui flows/update-forex.tag

// 添加注释?

添加代码注释。在使用条件或循环命令是,注释也要相应缩进,以便在转换为JavaScript代码后正确运行。

// 这里写注释,不会被程序运行

例子:

// 点击登录按钮

telegram?

telegram 是国外的一款聊天软件,中国使用人数极少。TagUI 通过发送 telegram 消息,及时获得机器人的工作结果或报错状态信息。国内一般都用 企业微信、钉钉等。

首先要获得 @taguibot 发消息授权,然后再用 TagUI 下面的命令:

telegram [id] [message]

例子:

// this line sends message to Telegram user with ID 1234567890, \n means a new line
telegram 1234567890 Hello Alena,\n\nYour HR onboarding bot has completed successfully.

// show telegram_result variable - 'success' means sent, 'fail' means sending failed
echo Telegram message - `telegram_result`

// if condition to check telegram_result 'success' or 'fail' and handle accordingly
if telegram_result equals to 'success'
  echo Message sent successfully.
else
  echo Message sending failed.

请注意,telegram 步骤需要互联网连接。This feature is being hosted at https://tebel.org, but the source code is on GitHub if you wish to host this feature on your own cloud or server. The implementation is in pure PHP without any dependencies.

The only info logged is chat_id, length of the message, datetime stamp (to prevent abuse). If you wish to host on your own, first read through this link to learn more about Telegram Bot API, creating your bot API token and setting up the webhook - https://core.telegram.org/bots

Run options 运行流程选项?

可以使用 tagui 命令,查看选项说明。

举例:这条命令运行 my_flow.tag 而隐藏Web浏览器,同时把流程运行结果存储到 tagui_report.csv 中。

tagui my_flow.tag -headless -report

-deploy or -d 生产CMD快捷方式?

创建一个可以双击运行流程的快捷方式。如果移动文件,则必须创建一个新的快捷方式。流程将在创建快捷方式时使用的所有选项运行。

-headless or -h 隐藏浏览器?

运行时,隐藏 Chrome Web浏览器(隐藏浏览器就无法使用 Visual Automation)。

-nobrowser or -n 不使用Web浏览器?

不使用Web浏览器,例如仅使用可视自动化执行自动化。

-report or -r 保存HTML日志?

追踪流程运行结果,记录在tagui/src/tagui_report.csv 中,并保存流量执行的HTML日志。

-turbo or -t 十倍速运行?

在10倍的速度下运行流程。谨慎使用!

-quiet or -q 减少非主动信息输出?

除了 echo, show, check steps and errors etc 之外,不显示其他输出。在执行期间显示和隐藏输出的细粒度控制(例如,隐藏密码显示出来), 可以在流处里使用 quiet_mode = truequiet_mode = false 进行控制。

-edge or -e 使用Edge浏览器?

使用 Microsoft Edge浏览器而不是Chrome运行(可与-headless选项一起使用)。

my_datatable.csv?

使用指定的CSV文件作为批量自动化的DataTable。查看 datatables

input(s) 流程参数?

添加您自己的流程参数,在您的流程中做为变量P1至P8使用。

例如在CMD里,运行 register_attendence.tag 流程,需要用 Edge 浏览器,同时向该流程输入4个变量(4个人名)。

tagui register_attendence.tag -edge Jenny Jason John Joanne

在流程里, 4个人名会自动分配给4个变量 p1, p2, p3, p4 。例如在需要输入不同数据时,就特别方便,下面的命令会显示出这4个变量,你可以试试。

echo `p1`
echo `p2`
echo `p3`
echo `p4`

参考: 其它弃用的流程参数.

辅助函数?

csv_row()?

以数组方式写入CSV文件。

例子:

read name_element to name
read price_element to price
read details_element to details
write `csv_row([name, price, details])` to product_list.csv

count() 数量计算?

获取符合指定元素特征的元素数,例如计算有多少个新闻标题,然后用for读取它们。请注意,元素特征需要单引号 ''

例子:

rows = count('table-rows')

clipboard() 剪贴板?

将文本放在剪贴板上,或获取剪贴板文本。

例子:

clipboard('some text')
keyboard [ctrl]v

keyboard [ctrl]c
contents = clipboard()

url() 获取当前URL?

获取当前网页的URL。

例子:

if url() contains 'success'
  click button1

title() 获取当前网页标题。?

获取当前网页的标题title。

例子:

if title() contains 'Confirmation'
  click button1

text()?

获取当前网页的所有文本内容。

例子:

if text() contains 'success'
  click button1

timer()?

获得一段命令执行的时间周期,时间单位:秒。

例子:

timer()
click button1
click button2
click button3
echo `timer()`

exist() 等待元素出现?

等待元素出现,如果元素出现返回true ,如果元素等待时间超时,元素还没有出现,就返回 false,通常在网页搜索、查询等流程时使用本命令,以确定查询结果已经出现后,才继续下面的流程。请注意,元素特征包含在引号 '' 内。
可以使用 DOM, XPath, Image 进行目标定位。
exist('[DOM/XPath/Image]')

例子:

if exist('//table')
  click button1

present() 判断元素是否存在?

判断元素是否存在,并且直接返回 truefalse
请注意,元素特征包含在单引号 ' 内。
可以使用 DOM, XPath, Image 进行目标定位。

例子:

if present('//table')
  click button1

mouse_xy()?

获取当前鼠标位置的x,y坐标。
适合用在 live mode

例子:

echo `mouse_xy()`

mouse_x()?

获取当前鼠标位置的 x 坐标。

例子:

hover element.png
x = mouse_x() + 200
y = mouse_y()
click (`x`,`y`)

mouse_y()?

获取当前鼠标位置的 y 坐标。

例子:

hover element.png
x = mouse_x() + 200
y = mouse_y()
click (`x`,`y`)

get_files()?

获取文件或文件夹列表,支持相对和绝对路径。Returns an array of files and folders in a given folder. Both relative and absolute paths supported.

例子:

// list of files in the same folder as the flow file
list = get_files('.')

// list of files in the Desktop folder of user Alan
// note double backslash because of JavaScript string
list = get_files('C:\\Users\\Alan\\Desktop')

// alternatively, use single forward slash instead
list = get_files('C:/Users/Alan/Desktop')

// showing the list of files after retrieving it
// JavaScript array start from 0 for 1st element
for n from 0 to list.length-1
  echo `list[n]`

// checking to process a specific file extension
for n from 0 to list.length-1
  if list[n] contains '.XLSX'
    echo `list[n]`

get_text() 截取文本?

从文本中提取2的锚点之间的文本。当有多个匹配结果时的可选第4参数(例如,3判断函数返回找到的第3匹配)。Extracts text between 2 provided anchors from given text. Optional 4th parameter for occurrence during multiple matches (for example 3 to tell the function to return the 3rd match found).

例子:

pdf_text = 'Name: John State: Texas City: Plano Contact: ...'

name = get_text(pdf_text, 'Name:', 'State:')
state = get_text(pdf_text, 'State:', 'City:')
city = get_text(pdf_text, 'City:', 'Contact:')

echo `name`, `state`, `city`

del_chars() 删除文本?

删除特征字符后的文本,并返回结果来清除数据。Cleans data by removing provided character(s) from given text and returning the result.

例子:

pdf_text = 'Name: John\n State: Texas\t City: Plano\n Contact: ...'
echo `del_chars(pdf_text, '\n\t:')`

get_env() 获得当前用户环境变量?

从操作系统返回给定环境变量的值。例如:C:\Users\Administrator

例子:

// getting %USERPROFILE% variable for Windows
echo `get_env('USERPROFILE')`
home_dir = get_env('USERPROFILE')

// getting $HOME variable for Mac or Linux
echo `get_env('HOME')`
home_dir = get_env('HOME')