Add date to JMdict file name

main
Elnu 1 year ago
parent e8c071c2a9
commit 1792926dfd

2
data/.gitignore vendored

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

@ -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

Loading…
Cancel
Save