Home > OS >  Add Table To Markdown File Via Windows Command Line
Add Table To Markdown File Via Windows Command Line

Time:05-05

I'm trying to append a table in a markdown file via command line. First, I make a new directory, cd into the directory, and then create an MD file, and then add a table. I'm getting an error with this command that says: | was unexpected at this time.. Anyone know how to insert a table into an MD file via command line?

mkdir Project_Name & cd Project_Name & echo # Notes > notes.md & echo |Name|Position|email|phone|website 1|website 2|website 3|
|---|---|---|---|---|---|---| >> notes.md

CodePudding user response:

The PIPE | symbol has other functions within command line

So you would need to use quotes to place those character into your file

echo "|Name|Position|email|phone|website 1|website 2|website 3| |---|---|---|---|---|---|---|"

Use of the escape character to use certain characters will not put the quotes into your file.

echo ^|Name^|Position^|email^|phone^|website 1^|website 2^|website 3^| >>notes.md & echo ^|---^|---^|---^|---^|---^|---^|---^| >>notes.md

  • Related