echo "digraph {" echo "" cat partial-cleaner.txt \ | sed s/"\""/" "/g \ | sed s/"'"/" "/g \ | sed s/" "/" -> "/g \ | tr --delete "\n" \ | sed s/" -> -> "/" -> "/g \ | sed s/"^ -> "//g \ | sed s/" -> $"//g echo "" echo "" echo "}" # tr: translate or delete characters # sed: a find and replace tool # $ sed s/search/replace/options # this is the main syntax of sed's s command # s: stands for substitute # g = replace all matches