Try this:
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var inputFile = FSO.OpenTextFile(Watch.GetJobFileName(),1);
var outputFiles = {};
var stateProv = "";
var line="";
// Eliminate header line
line = inputFile.ReadLine();
while (!inputFile.AtEndOfStream) {
line = inputFile.ReadLine();
stateProv = line.split(",")[7];
// Check if property exists, otherwise create it and assign newly created file handle to it
if(!outputFiles[stateProv]){
outputFiles[stateProv] = FSO.CreateTextFile("C:\\Tests\\Output\\" + stateProv + ".txt");
}
outputFiles[stateProv].WriteLine(line);
}
//Close all files
for(var i in outputFiles) outputFiles[i].Close();