Online Documents
繁體中文
繁體中文
  • First Launch Experience
  • How to Train EMILY?
  • Simple Web Automation
  • Web Automation Tools
  • Web Automation Processor
  • User Fill
  • Workspace Script
  • File Exporter
  • File Enumerator
  • EXCEL Processor
  • EXCEL Analyzer
  • EXCEL Writer
  • EXCEL Filler
  • CSV Creator
  • PowerShell
  • PDF Analyzer
  • Mail Sender
  • Mail Reader
  • Exchange Mail Sender
  • Exchange Mail Reader
  • HTTP Analyzer
  • Command Line
  • DOCX Templater
  • SQL Executor
  • Desktop Automation (DA)
  • SFTP
  • JSON API Server
  • Chart
  • DOCX2HTML
  • Folder Processor
  • Google Drive
  • Google Sheets
  • Google OCR
  • Google NLU
  • Azure Form Recognizer
  • Anti-Captcha
  • ChatGPT
  • Gemini
  • Schedule Trigger
  • Mail Trigger
  • File Trigger
  • API Trigger
  • Protect Text
  • Flexibility & Security
  • Announcement
    • Version Releases
    • Third Party Notice
Powered by GitBook
On this page
  • OUTPUT FILENAME
  • input 輸入物件
  • output 輸出陣列

CSV Creator

建立 CSV 格式檔案

PreviousEXCEL FillerNextPowerShell

Last updated 2 years ago

OUTPUT FILENAME

輸出於工作資料夾的 CSV 格式檔案名稱(不需包含副檔名),如果檔案已存在工作資料夾內,內含的資料列將被預先載入 output 輸出陣列,讓腳本繼續新增資料列;腳本也可以主動刪除預載資料列讓輸出的表格重新開始。

input 輸入物件

在 input 物件中的每個 key 為工作資料夾中的一個 TXT 檔案名稱(不包含副檔名),每個 value 為該檔案的文字內容。

// 讀取工作資料夾中 row-name.txt row-price.txt 的值
let name = input['row-name']
console.log('name:', name)

let price = input['row-price']
console.log('price:', price)

output 輸出陣列

加入 output 陣列中的每個物件元素代表輸出表格的一列資料,物件中的 key 為表頭欄位,value 為該欄位在這一列資料的值。

// 新增資料列,資料來自工作資料夾內的檔案,讀取部分參考上方範例
output.push({
  name : name,
  price : price,
  tax: price * 0.05
})

// 指定表頭欄位,順序由左至右
output.header.push('name','price','tax')