Page 1 of 1

AppDeveloper How to use CSV read/write

Posted: Fri Jan 16, 2026 5:36 pm
by stefan.erni
Hi Ben

Writing a file works perfectly, if I use delay

reading doesn't go so well

I don't know exactly how to use CSV read/write.
Writing a CSV file works well with the next row command.
But when reading the CSV file, I don't know if I need the command.

Sometimes when creating and writing the file, I end up with an empty file.
If I already have an empty file, then it works fine when I start the program a second time.
I don't know where I need to wait.

Sometimes I still get a lot of 000000 if I open it with notepad.
2026-01-16_18-08-56.PNG
2026-01-16_18-08-56.PNG (9.61 KiB) Viewed 484 times
One command gets stuck readAsNumber(1,0) but the others work.
2026-01-16_18-17-08.PNG
2026-01-16_18-17-08.PNG (93.8 KiB) Viewed 484 times


Testprogram:
post_csv1.fcpcd
(44.24 KiB) Downloaded 72 times

Re: AppDeveloper How to use CSV read/write

Posted: Thu Jan 22, 2026 3:48 pm
by stefan.erni
Hi Ben

I have written a file that generate 10 files and some with extra long filename.
A problem is with the simulation speed.
Can I set it always to full speed?
So I'll start testing “reading CSV into an array.”
The file I need to read has about 12,000 lines.

If this is on second place and the file is small, there is a problem
2026-01-22_15-15-15.PNG
2026-01-22_15-15-15.PNG (17.21 KiB) Viewed 321 times
2026-01-22_16-20-40.PNG
2026-01-22_16-20-40.PNG (35.35 KiB) Viewed 321 times
If this is on first place
2026-01-22_16-27-51.PNG
2026-01-22_16-27-51.PNG (15.34 KiB) Viewed 321 times
it's perfect without a delay and short or long files are ok
2026-01-22_13-56-25.PNG
2026-01-22_13-56-25.PNG (34.65 KiB) Viewed 321 times
With the lot of zeros it's just write number a problem, write int and write strg is ok.
I think it's because of write float (and not a problem).
2026-01-22_11-54-20.PNG
2026-01-22_11-54-20.PNG (24.91 KiB) Viewed 321 times
Testprogram:
post_csv_write2.fcpcd
(15.61 KiB) Downloaded 48 times

Re: AppDeveloper How to use CSV read/write

Posted: Fri Jan 23, 2026 9:00 am
by stefan.erni
Hi Ben

I wrote a program to read a csv file generate from an FC11 App.
Sensor_1_FC11.csv is the original file
Senser_1_excel_4row.csv is open and save in excel as csv file.

the comma at the end is gone after save.
2026-01-23_08-52-35.PNG
2026-01-23_08-52-35.PNG (52.14 KiB) Viewed 299 times


read seq ist working if I add some read but this does not match anymore after excel
2026-01-23_09-52-28.PNG
2026-01-23_09-52-28.PNG (156.18 KiB) Viewed 299 times
2026-01-23_09-31-44.PNG
2026-01-23_09-31-44.PNG (67.6 KiB) Viewed 299 times
2026-01-23_09-30-56.PNG
2026-01-23_09-30-56.PNG (122.43 KiB) Viewed 299 times
read number is not working (anymore)
2026-01-23_09-43-15.PNG
2026-01-23_09-43-15.PNG (58.55 KiB) Viewed 299 times
program
post_csv2_read.fcpcd
(29.91 KiB) Downloaded 48 times
csv file:
Sensor_1_FC11.csv
(538.78 KiB) Downloaded 43 times
Sensor_1_excel_4row.csv
(170.18 KiB) Downloaded 47 times