Created
May 16, 2010 01:01
-
-
Save jasonm23/402550 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep '<eventImage' config_en.xml | sed -e 's/[^\=]*\="\([0-9]*\)" value\="\([^.]*\)\.png"\/>/\1 \2/' | cat -n | wra b c; do echo "INSERT INTO event_type_numbers VALUES($a, '$b', '$(ds)', '$(ds)', 1, $(grep $c types.txt | sed 's/\([0-9]*\).*/\1/'));"; done | |
# find <eventImage nodes and grab their name value pairs, add line numbers, while read and split into a, b, c, (alias wra) then create a sql insert, $(ds) is a datestamp alias, then define the last column by searching for the image name in a list called types, and insert the associated ID num. and done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use pup or some other cmdline dom parser if you have to stay in the shell.