[FREE] CSV Tools Extension to work with CSV Files

csv

CSV Tools

An extension for MIT App Inventor 2.
Extension to work with CSV files async. Developed by The K Studio.

:memo: Specifications


:floppy_disk: Size: 13.37 KB
:gear: Version: 2.1
:iphone: Minimum API Level: 7
:date: Updated On: 2025-02-03T18:30:00Z
:computer: Built & documented using: FAST-CLI

Events:

CSVTools has total 4 events.

:yellow_heart: OnCSVCreated

OnCSVCreatedBlock

Event triggered when a CSV file is successfully created.

Parameter Type
filePath text

:yellow_heart: OnCSVRead

OnCSVReadBlock

Event triggered when a CSV file is successfully read.

Parameter Type
data list

:yellow_heart: OnError

OnErrorBlock

Event triggered when an error occurs while processing CSV file.

Parameter Type
errorMessage text

:yellow_heart: OnFileUpdated

OnFileUpdatedBlock

Triggered when a CSV file is successfully updated.

Parameter Type
filePath text

Methods:

CSVTools has total 13 methods.

:purple_heart: ReadCSV

ReadCSVBlock

Reads a CSV file from the specified file path. Give a full path to read file from local storage or specify file name from assets to read file from assets.

Parameter Type
filePath text

:purple_heart: CreateCSV

CreateCSVBlock

Creates a CSV file from a list of columns or rows and saves it to the specified file path. Here data is list of columns or list of rows specified by isColumn boolean.

Parameter Type
filePath text
columns list

:purple_heart: GetColumnCount

GetColumnCountBlock

Returns the number of columns in the CSV file.

Parameter Type
data list

:purple_heart: GetRowCount

GetRowCountBlock

Returns the number of rows in the CSV file.

Parameter Type
data list

:purple_heart: GetRow

GetRowBlock

Returns the data of a specific row in the CSV file.

Parameter Type
data list
rowIndex number

:purple_heart: GetColumn

GetColumnBlock

Returns the data of a specific column in the CSV file.

Parameter Type
data list
columnIndex number

:purple_heart: GetCellValue

GetCellValueBlock

Returns the value of a specific cell in the CSV file.

Parameter Type
data list
rowIndex number
columnIndex number

:purple_heart: GetCellValueByColumnName

GetCellValueByColumnNameBlock

Returns the value of a cell specified by column name and row index in the CSV file.

Parameter Type
data list
columnName text
rowIndex number

:purple_heart: UpdateCellValue

UpdateCellValueBlock

Updates a specific cell in the CSV file and saves changes.

Parameter Type
filePath text
rowIndex number
columnIndex number
newValue text

:purple_heart: UpdateRow

UpdateRowBlock

Updates an entire row in the CSV file based on index (1-based index).

Parameter Type
filePath text
rowIndex number
newRowData list

:purple_heart: UpdateColumn

UpdateColumnBlock

Updates a specific column in the CSV file (1-based column index).

Parameter Type
filePath text
columnIndex number
newColumnData list

:purple_heart: GetASD

GetASDBlock

Returns the app's specific external directory path.

:purple_heart: IsCompanion

IsCompanionBlock

Returns true if the app is running in the Companion.

Downoad:

Version 2.1: com.thekstudio.csvtools.aix (13.4 KB)

Test.aia (54.5 KB)

7 Likes

Thanks for this great extension

1 Like

it's not clear for me the path /assets, can you explain me ?
efa2060cac4b89a99998eb7f5a9feb0635c15163_2_1035x378

This will only work with Companion and Android 10+.
(I didn't test this extension.)

@The_K_Studio is the extension able to read a csv file from the assets after building the app?
which path must be used in this case?

Taifun

Possibly

image

?

Yes.

If the path starts from "/storage" then it reads from local storage else specify the file name from assets to read it from app assets in Apk eg. Test.csv

2 Likes

Thankyou very much for this extension.

Hi, Can you correct my mistake in this block?

file path is not correct

1 Like

See here example blocks to read file from ASD in Companion.

If you want to read the file from Download folder then dont Use Get ASD block. Directly specify the file path.

1 Like

1 Like

How can I achieve this?

  1. Imagine that a .csv file is with the data of Kids Name in one column and Roll Numbers in another column.

  2. If there is a word 'Passed Urine in Class' in the next cell of any random roll number, after 5 minutes this data 'Passed Urine in Class' must be deleted automatically from the .csv file. (This data will be added manually but has to be deleted automatically).

How this extension help to achieve this?

this extension is a csv READER, not to modify the file.

Yes, If we can read then we can modify by including other blocks from text section.

csv file can be read, write with FILE component, no need extension.

1 Like

Without extension how it is possible to read? And, can we read text file as well?

I tried as you told, but not working.

I tried using both format of filepath.

I mean that I used the same path format that should be used for MFile in this CSV Reader extension as well. That is what I meant.