Skip to content

Instantly share code, notes, and snippets.

@berdosi
Created December 11, 2009 00:00
Show Gist options
  • Save berdosi/253838 to your computer and use it in GitHub Desktop.
Save berdosi/253838 to your computer and use it in GitHub Desktop.
#!/bin/bash
OUTFILE="$1.pau"
echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--This is a lesson file for Pauker (http://pauker.sourceforge.net)-->
<Lesson LessonFormat="1.7">
<Description/>
<Batch>' > $OUTFILE
sed $1 -e 's#\(.*\)\t\(.*\)# <Card>\n <FrontSide Orientation="LTR" RepeatByTyping="false">\n <Text>\1</Text>\n </FrontSide>\n <ReverseSide Orientation="LTR" RepeatByTyping="false">\n <Text>\2</Text>\n </ReverseSide>\n </Card>#' >> $OUTFILE
echo ' </Batch>
<Batch/>
<Batch/>
</Lesson>
' >> $OUTFILE
gzip $OUTFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment