zigslice/exceltk
À propos
Convert Excel sheet to markdown, json, tex, html, image and so on..
Design et médiasProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalExcel toolkit.
Table SHOULD be edited by advanced GUI applications, BUT converted to any other format.
Convert Excel sheet to MarkDown Table
- HyperLink cell in Excel sheet will be retained as
[text](url)format - CrossLine cell in Excel sheet will be expanded to multirow
- Empty columns on the right side will be trimed (sampled from the first 100 rows for speed; columns that appear later are still kept when encountered during the full read).
- Support set the precision of decimal
- Support to set markdown table aligin
- Convert newline in cell text into
<br/> - Cross sheet Hyperlink formula support, link formula like
HYPERLINK(test_sheet!C9,...)will be extract as[text](url)format automatic - Hyperlink formula support, link formula like
HYPERLINK(C9,...)will be extract as[text](url)format automatic - MultiMarkdown mode (
-mmd): emit HTML tables withrowspan/colspanfor Excel merged cells (pipe Markdown cannot express rowspan)
Convert CSV to MarkDown Table
- Same markdown options as Excel (
-p,-a,-bhead,-pretty) - Quoted fields and embedded commas are supported (RFC 4180 style)
- Input via
-xls file.csvor-csv file.csv
Pretty MarkDown tables
- Use
-prettyto pad cell text and separators so columns line up in the source - Works with
-a l|c|ralignment
MultiMarkdown merged cells
- Use
-mmdto emit an HTML<table>withrowspan/colspanfrom Excel merge regions - HTML tables are valid in MultiMarkdown documents; standard pipe Markdown cannot express rowspan
- Currently supported for
.xlsxworksheets that declaremergeCells
Usage:
exceltk.exe -t md -xls example.xlsexceltk.exe -t md -xls example.xls -sheet sheetnameexceltk.exe -t md -xls example.xlsxexceltk.exe -t md -xls example.xlsx -sheet sheetnameexceltk.exe -t md -xls example.csvexceltk.exe -t md -csv example.csvexceltk.exe -t md -pretty -xls example.xlsx, pad columns so the markdown source looks alignedexceltk.exe -t md -mmd -xls example.xlsx, MultiMarkdown-friendly HTML table preserving merged cellsexceltk.exe -t md -p 2 -xls example.xls, where-p 2setting the decimal precision to 2exceltk.exe -t md -bhead -xls example.xls, which will use the first row to replace table header, and keep the head empty, so that the table will auto response in small screen device, this is just a simply solution.exceltk -t md -a r -xls example.xlsx, where the-aoption can be followd by a aligin character-a l: aligin left-a r: aligin right-a c: aligin center
Removed: clipboard monitor (-t cm)
-t cm(GUI clipboard watcher) existed only in 0.0.9 on Windows and was removed afterwards- Current versions convert files with
-t md|json|texinstead - If you still need 0.0.9, look for an archived asset on Releases (do not rely on README version matrices)
Convert Excel to Json
change the -t option to json
exceltk.exe -t json -xls example.xls- JSON is emitted as an ExcelTk
TableDocument(marker=EXCELTK1) so it can be imported back
Convert Excel to TeX
change the -t option to tex
exceltk.exe -t tex -xls example.xls- using
-st noption to split table into multitable - using
-snoption to adjust number, for example,1234656will be split into1 2 3 4 5 6, it the table width is too large, this is useful
Format plugins (export / import)
Output formats are plugins (md, json, tex, img). Each plugin can export Excel/CSV and import back to .xlsx.
- Export:
exceltk -t <plugin> -xls file.xlsx [-sheet name] [-out prefix] - Import:
exceltk -t <plugin> -import file.ext [-out out.xlsx]
Precise payloads use marker EXCELTK1 (Markdown HTML comment, TeX % comment, JSON field, or PNG private chunk tkXl).
Marked image plugin (-t img)
- Export renders a PNG preview and embeds the table payload in a private PNG chunk
- Import only accepts ExcelTk-marked PNGs; unmarked images are rejected
exceltk -t img -xls example.xlsxexceltk -t img -import exampleSheet1.png -out restored.xlsx
Download
Prebuilt binaries are published through GitHub Releases (CI builds self-contained packages for each RID on version tags v*).
- Latest release: https://github.com/fanfeilong/exceltk/releases/latest
- All releases: https://github.com/fanfeilong/exceltk/releases
Pick the asset that matches your OS:
| Asset RID | Platform |
|---|---|
linux-x64 |
Linux x64 (.tar.gz) |
osx-x64 |
macOS Intel (.tar.gz) |
osx-arm64 |
macOS Apple Silicon (.tar.gz) |
win-x86 |
Windows (.zip) |
Example asset name: exceltk-0.1.4-linux-x64.tar.gz.
To cut a release: tag vX.Y.Z and push; .github/workflows/release.yml publishes the assets.
3rd projects
ExcelTk integrated the following projects
How to build
Requires .NET 10 SDK (LTS). A global.json at the repo root pins SDK 10 with rollForward: latestMajor.
Quick check (any OS):
dotnet build src/Exceltk/Exceltk.csproj -c Release
dotnet run --project src/Exceltk/Exceltk.csproj -c Release -- -t md -xls src/test/test1.xlsx
Tip: put
--before app args when usingdotnet run, so options like-t/-aare not eaten by thedotnetCLI.
Optional: if dotnet restore feels slow because of publish RIDs, you can temporarily remove or comment the RuntimeIdentifiers block in src/Exceltk/Exceltk.csproj.
CI: GitHub Actions (.github/workflows/ci.yml) builds on .NET 10 and runs src/test.sh.
Architecture note: binary/OpenXML reading is organized as streaming packages (emit a complete local format unit as soon as it is recognized) so a renderer can progress while data is still arriving — see docs/streaming-packages.md.
Output formats are plugins with export/import — see docs/format-plugins.md.
Build on MacOS
dotnet publish -r osx-x64 src/Exceltk/Exceltk.csproj -c Release
# Apple Silicon:
dotnet publish -r osx-arm64 src/Exceltk/Exceltk.csproj -c Release
Build on Windows
dotnet publish -r win-x86 src/Exceltk/Exceltk.csproj -c Release
Open src/exceltk.sln (SDK-style Exceltk.csproj) in Visual Studio / VS Code. The legacy exceltk_vs.sln / Exceltk_vs.csproj (.NET Framework) is obsolete.
Build on Linux (example: ubuntu / linux-x64)
- Install the .NET 10 SDK
- From the repo root:
dotnet restore src/Exceltk/Exceltk.csproj
dotnet build src/Exceltk/Exceltk.csproj -c Release
dotnet run --project src/Exceltk/Exceltk.csproj -c Release -- -t md -xls src/test/test1.xlsx
- Publish a linux binary:
dotnet publish -r linux-x64 src/Exceltk/Exceltk.csproj -c Release
# output under: src/bin/net10.0/linux-x64/publish/exceltk
./src/bin/net10.0/linux-x64/publish/exceltk -t md -xls src/test/test1.xlsx
linux-x64 is the portable RID for Ubuntu and most x64 Linux distros. Other RIDs: https://learn.microsoft.com/dotnet/core/rid-catalog
Explorer des projets similaires
Chargement…