Add date to JMdict file name

This commit is contained in:
Elnu 2023-07-25 10:27:26 -07:00
parent e8c071c2a9
commit 1792926dfd
2 changed files with 7 additions and 2 deletions

2
data/.gitignore vendored
View file

@ -1 +1 @@
JMdict.xml JMdict*.xml

View file

@ -6,5 +6,10 @@ wget http://ftp.edrdg.org/pub/Nihongo/JMdict.gz
# Extract and delete archive # Extract and delete archive
gzip -d JMdict.gz gzip -d JMdict.gz
# Get date
date=`grep -m 1 -oE '<!-- JMdict created: [0-9]{4}-[0-9]{2}-[0-9]{2} -->' JMdict.xml | sed -E 's/<!-- JMdict created: (.+) -->/\1/'`
rm JMdict*.xml
# Add XML extension # Add XML extension
mv JMdict JMdict.xml mv JMdict JMdict-${date}.xml