• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need to Delete Particular Column in .csv

Enthusiast ,
Dec 01, 2016 Dec 01, 2016

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)

Screen Shot 2016-12-01 at 09.58.44.png

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

TOPICS
Scripting

Views

328

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 01, 2016 Dec 01, 2016

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).

Votes

Translate

Translate
Community Expert ,
Dec 01, 2016 Dec 01, 2016

Copy link to clipboard

Copied

LATEST

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines