with open('testDat.txt', 'r') as f:
    data = f.read()

data = data.split('/')
data = [d.strip() for d in data if d.strip()]
data_bits = [int(d[1:], 16) for d in data]

with open('testDat_format.txt', 'w') as f:
    for i, d in enumerate(data_bits):
        if i % 16 == 0 and i != 0:
            f.write('\n')
        f.write('0x{:02X}'.format(d))
        if i % 16 != 15:
            f.write(',')
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence