Parse indented text input and generate a visually appealing tree diagram.
Clone this repository and run:
cc -o indentree indentree.c
indentree
reads indented text from standard input and outputs a tree diagram to standard output. For example, to visualize a file named input.txt
:
./indentree < input.txt
The program will process the indented text in input.txt
and print a corresponding tree diagram.
Given an input.txt
with the following content:
Edit me to generate
a
nice
tree
diagram!
:)
Use indentation
to indicate
file
and
folder
nesting
do cool
stuff
Running ./indentree < input.txt
will output:
.
└─ Edit me to generate
├─ a
│ └─ nice
│ └─ tree
│ ├─ diagram!
│ └─ :)
└─ Use indentation
├─ to indicate
│ ├─ file
│ └─ and
│ ├─ folder
│ └─ nesting
└─ do cool
└─ stuff