News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Spreadsheet viewer for tab-separated values (*.TSV or *.TAB) files

Started by jj2007, May 28, 2014, 10:53:07 PM

Previous topic - Next topic

jj2007

A little project inspired by Timo on the Pelles C Forum.

It reads in comma- or tab-separated values and displays them in a SysListView32. Content can be sorted by column, and since the underlying sort algo is stable, you can even sort by multiple columns (which finally explains my interest in fast stable sorts  :biggrin: ).

For a real life test, click "Download database" in the File menu. In case you want to find that part in the source, here it is:

case IdMenuDL
  MsgBox 0, "Retrieve a 10 MB database for testing?", "Download:", MB_OKCANCEL
  .if eax==IDOK
            UnzipInit "http://www.thisisprivatefolks/SomeDatabase.zip"
            .if Sign?
                  MsgBox 0, "Download failed, sorry", 0, MB_OK
            .else
                  Let LvFile$="MDG_Database.csv"
                  FileWrite LvFile$, UnzipFile(0)
                  UnzipExit
                  call LoadDatabase
            .endif
  .endif


Feedback welcome - requires MasmBasic version 28 May or later.

EDIT: Version 2 attached, fixes a bug with the status bar, plus this one:
You can delete columns using the LVM_DELETECOLUMN message. There's no way to delete them all at once; you need to do them one by one.

jj2007

Version 3 fixes an odd bug that crept in when building the tinf library: tinf.lib was built with SubSystem Console - and all code linked to it suddenly had a console window :(

jj2007

Latest version, still with warnings; inter alia, the Undo function is not reliable, and plotting huge columns may hang the application.

To use it, extract GuiTableControl.exe somewhere, then drag a *.tab or *.csv file over the executable. An example file is included, too.