getting u attribute value from file name, not what is encoded in json

also moved the function to preprocessing module since it is used by 3
different scripts.