Author Topic: Spreadsheet viewer for tab-separated values (*.TSV or *.TAB) files  (Read 2342 times)

jj2007

  • Member
  • *****
  • Posts: 9686
  • Assembler is fun ;-)
    • MasmBasic
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.
« Last Edit: May 31, 2014, 09:14:16 AM by jj2007 »

jj2007

  • Member
  • *****
  • Posts: 9686
  • Assembler is fun ;-)
    • MasmBasic
Re: Spreadsheet viewer for tab-separated values (*.TSV or *.TAB) files
« Reply #1 on: May 31, 2014, 09:16:33 AM »
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 :(