Can I cleanse or change data before exporting it to CSV?

Here is a link to writing to a text file for Katalon Studio.

How to create a Katalon method (Keyword) for writing to a text file with Java - Product Forums / Tips & Tricks - Katalon Community

A CSV file could be thought of as a text file with comma separators, so you might be like:

hoursRoleA = ...
hoursRoleA = hoursRoleA.replace(",", "")
hoursRoleB = ...
hoursRoleB = hoursRoleA.replace(",", "")
data.WriteToFile('projectTitle, hoursRoleA, hoursRoleB')

or maybe even try to write the hours direct to the file by using the double quotes,

data.WriteToFile('projectTitle, "${hoursRoleA}", "${hoursRoleB}"')