diff --git a/fromtext.sh b/fromtext.sh index 82367e7..b4cb953 100755 --- a/fromtext.sh +++ b/fromtext.sh @@ -11,7 +11,7 @@ main() { f="$(echo "$line" | awk -F$SEP "{print \$$c}")" [ -z "$f" ] && continue if [ "$filename" = '' ]; then - filename="$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -e 's/ /-/g' -e 's/[^a-z0-9-]//g')" + filename="$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -E -e 's/ /-/g' -e 's/[^a-z0-9-]//g' -n -e 's/^(.{0,128}).*$/\1/p')" fi echo "$f" > "$filename.$i.md" i=$((i+1))