diff --git a/foundrycleaner.sh b/foundrycleaner.sh index 94ab7b8..3257844 100755 --- a/foundrycleaner.sh +++ b/foundrycleaner.sh @@ -51,10 +51,20 @@ lineCombiner(){ ' "$tempfile" > "$OUTPUT_FILE" } +badLineRemover() { + grep -Ev "[0-9] {1,}" "$tempfile" > "$OUTPUT_FILE" +} + +outToTemp() { + cp "$OUTPUT_FILE" "$tempfile" +} + + ### RUNTIME ### cp "$INPUT_FILE" "$tempfile" +touch $tempfile case $1 in dice) @@ -72,11 +82,18 @@ case $1 in lines) lineCombiner ;; + badlinesrm) + badLineRemover + ;; auto) + lineCombiner + outToTemp + badLineRemover + outToTemp ListSort - cp "$OUTPUT_FILE" "$tempfile" + outToTemp RemoveNumbers - cp "$OUTPUT_FILE" "$tempfile" + outToTemp dice ;; *)