用什么工具来绘制文件树图 [英] What tool to use to draw file tree diagram

查看:223
本文介绍了用什么工具来绘制文件树图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个文件树 - 一个包含目录的目录等等,你将如何编写一个脚本来创建一个文件树的图表作为一个图形文件,我可以嵌入到文字处理器文档中。
我更喜欢矢量(SVG,EPS,EMF ...)文件。
该工具必须在Windows上运行,但最好是跨平台的。
该工具可能是商业的,但最好是免费的。



更新2012-02-20。
问题与文档子项目有关。我不得不解释文件(特别是资源和配置文件)在哪里。
我用dos树命令结束了。我都屏幕抓住了结果(短文件夹)和较长的文件夹我重定向到一个文本文件,然后我编辑。例如,如果一个子文件夹包含20个类似的文件,这些文件对于我所创建的点来说并不重要,我只剩下两个文件,用其中一行代替。然后我打印出来的文件再次控制和屏幕抓住它。
在屏幕抓取之前,我必须将前景色修改为黑色,并将背景色修改为白色,以便看起来更好,并在要打印的文档中保存墨迹。

它是没有更好的工具是非常令人惊讶的。如果我有时间,我会写一个Visio扩展,或者可能是一些生成SVG的命令行。 SVG是HTML5的不合格标准,甚至可以无痛地包含到在线文档中。



更新2017-10-17。
对不起,这个问题被删除,因为不属于SO。所以我重新措辞。我需要一个脚本 - 而不是一个所见即所得的。所以任何脚本语言或库都可以。所以这是一个代码写作的问题,我相信属于SO。从MS-DOS 命令复制和粘贴也可能为你工作。例子:



  C :\ Foobar>树
C :.
├───FooScripts
├───barconfig
├───Baz
│├───BadBaz
│└───Drop
...

树/ F

  C:\ Foobar>树
C :.
├───FooScripts
│foo.sh
├───barconfig
│bar.xml
├───Baz
│├─ ──BadBaz
││badbaz.xml
│└───Drop
...

tree / A

  C:\ Foobar> A 
C :.
+ --- FooScripts
+ --- barconfig
+ --- baz
| + --- BadBaz
| \ --- Drop
...

树/ F / A

  C:\Foobar>树/ A 
C :.
+ --- FooScripts
| foo.sh
+ --- barconfig
| bar.xml
+ --- Baz
| + - --BadBaz
| | badbaz.xml
| \ ---删除
...



语法 []



[ drive:] [ path ] [ / F ] [ / A ]


$ b


驱动器:\路径 - 驱动器和目录包含用于显示目录结构的磁盘,文件。



/ F - 包含每个目录中的所有文件。



/ A - 将用于链接行的图形字符替换为ext字符,而不是图形字符。 / a 与不支持图形字符的代码页一起使用,并将输出发送给不能正确解释图形字符的打印机。


< blockquote>

Given a file tree - a directory with directories in it etc, how would you write a script to create a diagram of the file-tree as a graphic file that I can embed in a word processor document. I prefer vector (SVG, EPS, EMF...) files. The tool must run on Windows, but preferably cross-platform. The tool may be commercial but preferably free.

Update 2012-02-20. The question was related to a documentation sub project. I had to explan where files (in particular resources and configuration files) reside. I ended up with using dos tree command. I both screen grabbed the result (for short folders) AND for longer folders I redirected to a text file, which I then edited. For example if a subfolder contained 20 similarly typed files that individually were not important to the point I was making, I left just two and replaced the rest with one ... line. I then printed out the file to console again and screen grabbed it. Before screen grabbing I had to modify foreground color to black and background color to white, to look better and save ink in a document should that be printed.

It is very surprising that there is no better tool for it. If I had time, I'd write a Visio Extension or may be some command line that produces SVG. SVG being HTML5 substandard, would even allow painless inclusion into online documentation.

Update 2017-10-17. I am sorry that this question was removed as not belonging to SO. So I have re-worded it. I need a script - not a WYSIWYG too. So any scripting language or library is ok. So it is a code - writing question, and I believe belongs to SO.

解决方案

Copying and pasting from the MS-DOS tree command might also work for you. Examples:

tree

C:\Foobar>tree
C:.
├───FooScripts
├───barconfig
├───Baz
│   ├───BadBaz
│   └───Drop
...

tree /F

C:\Foobar>tree
C:.
├───FooScripts
│    foo.sh
├───barconfig
│    bar.xml
├───Baz
│   ├───BadBaz
│   │    badbaz.xml
│   └───Drop
...

tree /A

C:\Foobar>tree /A
C:.
+---FooScripts
+---barconfig
+---Baz
¦   +---BadBaz
¦   \---Drop
...

tree /F /A

C:\Foobar>tree /A
C:.
+---FooScripts
¦    foo.sh
+---barconfig
¦    bar.xml
+---Baz
¦   +---BadBaz
¦   ¦    badbaz.xml
¦   \---Drop
...

Syntax [source]

tree [drive:][path] [/F] [/A]

drive:\path — Drive and directory containing disk for display of directory structure, without listing files.

/F — Include all files living in every directory.

/A — Replace graphic characters used for linking lines with ext characters , instead of graphic characters. /a is used with code pages that do not support graphic characters and to send output to printers that do not properly interpret graphic characters.

这篇关于用什么工具来绘制文件树图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆