const SUBJECT_TEMPLATE = `
// subject title 1
Subject::factory()->create([
    'subjectTitle' => 'subject title 1',
    'syllabusDetails' => 'syllubus details 1',
    'deleted' => 'false',
  ]);
`.trim();

const fs = require('fs');

const subject_list_raw = fs.readFileSync('./subject_list.txt', { encoding: 'utf-8' });
const subject_list = subject_list_raw.split('\n').map(r => r.split(': '));

const subject_list_out = subject_list.map(s =>
    SUBJECT_TEMPLATE.replace(/subject title 1/g, s[0]).replace(/syllubus details 1/g, s[1]),
);

fs.writeFileSync('./write_subject.out', subject_list_out.join('\n\n'), { encoding: 'utf-8' });
