Copy link to clipboard
Copied
Hi All,
1. My Script will read the first line or column Heading,
if the first line match with the "Report" content, that column should be delete.
For more clarification, please refer the screenshot below (REPORT column need to be delete)
var csvFile=File(Folder.desktop + "/sample.csv");
csvFile.open("r");
alert(csvFile.readln().split("\r"))
while(csvFile.eof == false)
{
var myColumn = csvFile.readln().split(",");
alert(myColumn[2])
myColumn[2].remove(); //Help this line
}
Kindly help for the above request.
Regards
Siraj
This is not InDesign JavaScript, it's the regular kind. Please keep your questions on-topic.
For this, you need the standard JavaScript function 'splice': Array.prototype.splice() - JavaScript | MDN
A full explanation is here: How to remove a particular element from an array in JavaScript? - Stack Overflow (which you could have found the same way as I did, by tpying your question in Google).
Copy link to clipboard
Copied
This is not InDesign JavaScript, it's the regular kind. Please keep your questions on-topic.
For this, you need the standard JavaScript function 'splice': Array.prototype.splice() - JavaScript | MDN
A full explanation is here: How to remove a particular element from an array in JavaScript? - Stack Overflow (which you could have found the same way as I did, by tpying your question in Google).