Giter VIP home page Giter VIP logo

vscode-excel-to-markdown-table's Introduction

excel-to-markdown-table README

This VSCode extension converts Excel data to Markdown table format. Available through command Excel to Markdown table and keyboard shortcut Shift+Alt+V.

excel-to-markdown-table

Optionally align columns by prepending the headers with ^[lcr] for left, center and right alignment. E.g ^lHeader for left aligning the columns named Header.

Based on https://github.com/thisdavej/copy-excel-paste-markdown and the work of @jonmagic and @thisdavej

Contributors

  • @deshorsley for bug fix and test coverage!
  • @tylerhaigh for refactoring and test coverage!
  • @usagi for new line handling and refactoring!
  • @trackds for migrating to internal VSCode clipboard API

Known Issues

  • None

vscode-excel-to-markdown-table's People

Contributors

csholmq avatar dependabot[bot] avatar deshorsley avatar trackds avatar tylerhaigh avatar usagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-excel-to-markdown-table's Issues

Could not build: npm ERR! 404 Not Found - GET https://registry.npmjs.org/flatmap-stream/-/flatmap-stream-0.1.0.tgz

I have a problem that same as #3. Then, I trying fork-and-fixing. But I could not build it with the error in the below:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/flatmap-stream/-/flatmap-stream-0.1.0.tgz
npm ERR! 404
npm ERR! 404  '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'vscode-excel-to-markdown-table'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

  • npm --version -> 6.13.4
  • OS -> Windows 10 64-Bit Version 1903 ( build 18362.535 )

It doesn't seem to work with Remote - SSH

Other things being equal, it works fine local, but it doesn't work on remote-ssh. It doesn't seem to be getting data from Clipboard

local:

| aa | bb |
|----|----|
| cc | dd |

remote:

|  |
|--|

"*" needs to be escaped, for example: "/*" "*/" or simple *

I document data models in Excel and export some of them into WIKI entries, the content in Excel contains comments like

/*this is a comment
bla*bli*blum
*/

the plugin doesn't care about "*" and markdown will interpret parts of the content to italic:
/this is a comment
bla bli blum
/

"*" should be escaped when converted in markdown

Try this more complex example to check:

/*AT:
Sum(IIf([35]="nein",[18]-1,[21]-1)*[9]*[28]*[29]/100) AS Beitrag_BM, 
*/
(IIF(istMitBenchmark = 1, T1.TWR_BM_BW, [T1].[TWR_PF_BW]) - 1)
* T1.VOL_PF_BW

On a Mac, only shift+option+v works, not paste

Tried this on my Mac and thought I was going insane: selecting paste from the context menu only insert normal text. Then I tried the keyboard combination shift+option+vand it works !

about the copy-past npm package location

Dear csholmq,

I installed this vscode extension, and as instructed, I also installed via npm the copy-past package. However, I found this not working (by menu bar - view- command palette - Excel to Markdown table). I guess this might be due to the npm package's location. Should I install the copy-paste package globally, or to some certain dirs? Or should I put --save variable?

Handle empty cells

Currently, copying an Excel table with empty cells results in just the text being pasted into VS Code.

Steps to reproduce.

  1. Create an Excel table, but leave some cells throughout it empty
  2. Copy the table
  3. Use the Excel to Markdown pasting option in VS Code (or just Shift + Alt + V)
  4. See that there is no table markdown characters, just the contents of the cells.

paste Asian chars as "?"

When copying Asian characters(such as Chinese), the extension would not recognize them and paste them as "?"

I run the ts code in command line, and the scripts do recognize Asian chars. Could not figure why this happen.

Unclear documentation

I installed the converter to VS Code. However, when restarted the editor and pressing SHIFT+ALT+v I only see an open menu box and no way to convert the previously copied Excel sheet.

Please provide a clear, step by step description on how this works.

not work on mac

this extension not works on mac. thanks

vscode:
Version: 1.37.1
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:16:34.800Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

Excel:
office 2019 for mac

Does not properly handle cells with newlines in them

This extension does not properly handle Excel cells that have newlines in them. Here is some CSV that illustrates the issue. The issue presents itself with "Tax Rates" in the Label column.

Label,Content
Tax City Code,002
Tax City Name,Ada
Tax City Type,Village
Tax County Names,Hardin
Tax State Name,Ohio
Member Type,Full
FIPS Code,39-00198
Population,"5,952"
Postal Codes,45810
Income Cutoff,">= $5,000"
Growth Rate,3.0%
"Tax Rates
2002-2011
2011-2018","
1.15%
1.65%"
"Penalty Rate
Minimum
Maximum","1.5% monthly
$25 once
none"
Interest Rate,1.5% monthly
Tax Lottery,yes
Mandatory Filing,yes

Regex failing in Safari based devices (iOS)

I am reusing the code to copy excel data in Obsidian editor. One issue is that when running the code is iOS, the regex throws an error as lookbehind regex is not supported in Safari based devices.

Use of lookbehind regex in excel-markdown-helpers.ts

const EXCEL_NEWLINE_ESCAPED_CELL_REGEX = /"([^\t]*(?<=[^\r])\n[^\t]*)"/g;

Question: Is it possible to rewrite this regex without lookbehind regex? I am looking for your help as I didn't want to touch the regex without much context and introduce some regression by fixing this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.