Skip to content

Commit

Permalink
Removing useless lines + concat volumes into books (#11)
Browse files Browse the repository at this point in the history
* Removing useless lines + concat volumes into books
* Update bin/extract.sh
* Rm volumes within the "for" loop
  • Loading branch information
Maiann88 authored and fabi1cazenave committed Dec 26, 2024
1 parent 44e9733 commit 34b9633
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/extract.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/sh

mkdir -p txt
rm txt/*.txt

echo "Gutenberg..."
for corpus in corpus/gutenberg/*.txt
Expand All @@ -9,6 +10,17 @@ do
name=${file%.*}
echo "... $name"
cp $corpus txt/$name.txt
sed -i '/\[Illustration\]/d' txt/$name.txt
sed -i '1,/START OF THE PROJECT GUTENBERG/d' txt/$name.txt
sed -i '/END OF THE PROJECT GUTENBERG/,$d' txt/$name.txt
sed -i '/^End of Project Gutenberg/d' txt/$name.txt
sed -i '/\* \*/d' txt/$name.txt
done
for file in txt/*_[1-9].txt
do
volume=$(echo "$file" | sed 's/_[1-9].txt//g')
cat "$file" >> "$volume".txt
rm "$file"
done

echo "Leipzig..."
Expand Down

0 comments on commit 34b9633

Please sign in to comment.