'Add Table To Markdown File Via Windows Command Line
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
Solution 1:[1]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
