Hello everyone I’m sharing my new extension called ExcelTool.
To implement this extension
With this extension, you can directly read or write cells in Excel spreadsheets.
To implement this idea, I used the library jxl.jar (A Java library for reading/writing Excel - Browse Files at SourceForge.net if anyone would be interested)
The library has its own weight, so the extension is not small. Due to the library’s features, the extension works with XLS files, but not with XLSX files. To work with the latter type of files, you need to attach an even larger library, which is completely unjustified.
One more time. the extension works with XLS files (Excel 97-2003 format)
now briefly on the expansion blocks with examples:
filePath - the full path to the file. the example uses a third-party extension.
ListName- the name of the sheet in the table.
row , col - the requested cell
filePath - the full path to the file. the example uses a third-party extension.
ListName- the name of the sheet in the table.
row , col - cell coordinates
value the write value
array of values of all sheets in the xls file
searches for the specified value in the file. the result is reflected in the event. the format of the record will mean the coordinates of the cell. (for example 1-2 means row=1 and col=2)
exacMatch search for a complete match (true) or anything that contains the specified value partially (false)
converts file data to csv format
converts file data csv to xls file (excel format)
SearcResult event if there is no search result (does not find a value or text) returns the value 0 or the coordinates of the found value (array)
if you have any questions, write in the comments. I tried to make the extensions very clear
download:
version 1:ExcelTool.aix (918.1 KB)
version 2:ExcelTool_v2.aix (918.4 KB)
version3:
This version has been completely redesigned and contains updated code that includes automatic file type detection and SAF processing for working with files. The extension is now completely offline and does not require additional extensions to work with local files. it takes into account the work with SAF files (android version).
the blocks had to be completely changed, and the logic of the work too. so the updated blocks:
the block for specifying the file to be operated on. depending on the android version, the procedure will be determined . i.e. either the path will be accepted as specified (for android below 12) or a file selection dialog will be offered (for Android 12+). the event that follows after the function is executed will be reflected.
after specifying the file, you can perform read, write, search, and convert actions. I have set a corresponding event for each function. these are the function blocks with the response events:
reading from the specified cell:
writing to the specified cell:
searching for a value:
creating a new file:
file conversion:
download:
ExcelTool_v3.aix (923.7 KB)
version 4:com.ExcelTool.aix (367.0 KB)
The size of the extension has been significantly reduced due to the use of an alternative library and optimization, blocks for working with asset files have been added.
important! if you are working with asset files, then you cannot change them, you can only read information from them. here are the new blocks: