function main()

in transcriptTransformationScript.js [108:135]


function main(path) {
    console.log("Started");
    let contentBuffer;
    try {
        contentBuffer = fs.readFileSync(path);
    }
    catch (e) {
        console.log("Cannot open file", e.path);
        return;
    }
    let jsonTranscript = JSON.parse(contentBuffer);
    for (let i = 0; i < jsonTranscript.length; i++) {
        let currEntry = jsonTranscript[i];
        // Here we call to all the handlers we defined
        removeSchemaAttribute(currEntry);
        addSeparationAttribute(currEntry);
        convertNumbersToString(currEntry);
        convertColumnAttributesToCamelCase(currEntry);

    }
    try {
        const filename = path.replace(/^.*[\\\/]/, '').replace(/\.[^/.]+$/, ''); // Extracts filename without extension from full path.
        fs.writeFileSync(filename + '_transformed.transcript', JSON.stringify(jsonTranscript));
        console.log("Done");
    } catch (e) {
        console.log("Cannot write file ", e);
    }
}