Last active
November 4, 2023 14:54
-
-
Save karlarao/c14413ba48e84f4de4dac84a297da1f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# on mac: brew install tree | |
# on linux: yum install tree | |
## the XML output is 5 directories deep and filtering any folder name with "tmp" in it | |
tree -d -L 5 -X -I tmp /Users/karl/Dropbox/CodeNinja/GitHub | sed 's/directory/node/g'| sed 's/name/TEXT/g' | sed 's/tree/map/g' | sed '$d' | sed '$d' | sed '$d'| sed "1d" | sed 's/report/\/map/g' | sed 's/<map>/<map version="1.0.1">/g' > /Users/karl/Dropbox/CodeNinja/GitHub/Gitmap.mm | |
## to filter multiple folders do the following | |
tree -L 7 -I "tmp|node_modules|bower_components" | |
Pretty nice. I wish I could do the same in reverse. Like you design a folder structure in Freemind and then export it to XML or so and then create the whole tree on the system (with powershell,python,etc.)
Hi karlarao,
Is there a rule for random node id number? I am trying to generate id myself for .mm file, but failed to open them in ithought app. I felt there is a rule for random id, isn't it?
@C-Bam for PS it'd be something like:
function recursivelyCreateFolders($childFolders, $newFolder) {
foreach ($folder in $childFolders) {
Write-Host $Folder.Name
New-Item $Folder.Name -ItemType directory
if($Folder.childnodes.count -gt 0) {
cd ".\$($Folder.Name)"
recursivelyCreateFolders -childFolders $folder.ChildNodes -newFolder $newSubFolder
cd ..
}
}
}
$myDirs=Get-Content C:\File\Path\myDirs.xml
recursivelyCreateFolders -childFolders $myDirs.baseDir.ChildNodes -newFolder $NewFolder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a Mind Map File from a Directory Structure
sample output