0% found this document useful (0 votes)
6 views5 pages

Use Macros To Import and Write Data To External

The document describes the use of macros to import and write data to CSV files, detailing the process of reading data as a long string and separating it by commas. It outlines steps for extracting file paths, creating numerical input elements, and executing macros for reading and writing CSV files. The document also mentions offline simulation for reading and writing data to CSV files through button clicks.

Uploaded by

jamespidlaoan32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Use Macros To Import and Write Data To External

The document describes the use of macros to import and write data to CSV files, detailing the process of reading data as a long string and separating it by commas. It outlines steps for extracting file paths, creating numerical input elements, and executing macros for reading and writing CSV files. The document also mentions offline simulation for reading and writing data to CSV files through button clicks.

Uploaded by

jamespidlaoan32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Mochuan

Use macros to import and write data to external files

In this example, we use macros to read and write CSV files. CSV files

are character data separated by commas, so what we get when we

read the file is - a long string. We need to separate the data by

commas and put it into the consecutive address at the beginning of the

local register LWO. On the other hand, write a file by converting the

integer data into a string and concatenating it with commas into a

CSV file.

1. Extract the path and file name of the file, spell it together with

sprintf and put it into LW1000.

1
Mochuan

2. Make 3 columns of numerical display input elements.

3. Two macros were created to instruct read CSV file and write CSV

file respectively, and executed in the button.

2
Mochuan

3
Mochuan

4. Offline simulation

read the CSV file. After selecting the path, click Read button to execute

macro to read the CSV file data in the folder.

4
Mochuan

write the file, select the path, change the data, click Write button,

execute macro to write the changed data into the CSV file in this path.

You might also like