Created
December 17, 2018 10:09
-
-
Save timhodson/6fcf432a559141fc1266247692ef9e0e to your computer and use it in GitHub Desktop.
Make a linking table for list URI to Hierarchy URI.
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
# Utility called csvfix https://bitbucket.org/neilb/csvfix | |
# first pick the two columns we are interested in - list link, and hierarchy link. | |
# then split the hierarchy link (which is now colomn 2) on the semi-colon SPACE that is used to delimit. | |
# then unflatten - i.e. make a record(row) with the first column as key and each of the split columns as value. | |
# e.g. | |
# <key>,<val1>,<val2>,<val3> | |
# becomes | |
# <key>,<val1> | |
# <key>,<val2> | |
# <key>,<val3> | |
# and put it into a file as your linking table. | |
csvfix order -f 2, 8 all_lists_2017_09_21.csv\ | |
| csvfix split_char -f 2 -c '; '\ | |
| csvfix unflatten -k 1\ | |
> list-to-node-code-mapping.csv | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment