Changes for page 05 Lua Script

Last modified by Devin Chen on 2025/03/04 14:07

From version 41.1
edited by Hunter
on 2023/07/31 17:06
Change comment: There is no comment for this version
To version 44.1
edited by hunter123
on 2023/08/03 15:00
Change comment: Replaced user [xwiki:XWiki.Hunter] in fields [author, contentAuthor] to user [xwiki:XWiki.hunter123]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Hunter
1 +XWiki.hunter123
Content
... ... @@ -529,7 +529,20 @@
529 529  
530 530  [[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/csvRead.zip]]
531 531  
532 -The core code is from file readcsv.lua, and file path is set as Sheet_2023_06_13_15_29_45.csv at the root path for USB.
532 +The core code is from file readcsv.lua:
533 533  
534 +1) The file path is set as Sheet_2023_06_13_15_29_45.csv at the root path for USB;
535 +
536 +2) Remember to change csv separator in the second parameter from function csv_csvToTable according to user's need, this demo is using **semicolon** as separator;
537 +
534 534  (% style="text-align:center" %)
535 -[[image:luacsvfilereadcontent.png]]
539 +[[image:CSVreadwithsemicolon.png]]
540 +
541 +3) The reading content is a two-dimensional table, can use the table index to locate the specify data cell;
542 +
543 +For example, want to read the 2nd row C column from the table, the table index will be like table[2][3].
544 +
545 +(% style="text-align:center" %)
546 +[[image:celllocation.png]]
547 +
548 +
CSVreadwithsemicolon.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Hunter
Size
... ... @@ -1,0 +1,1 @@
1 +51.3 KB
Content
celllocation.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Hunter
Size
... ... @@ -1,0 +1,1 @@
1 +12.6 KB
Content