How can i Delete columns from many csv files?

5 ビュー (過去 30 日間)
sunil kusukuntla
sunil kusukuntla 2016 年 4 月 4 日
コメント済み: Shameer Parmar 2016 年 7 月 29 日
Hey! i have 500-600 csv files all having same headings in them ,i want to delete some colomns from them.could anyone help me with a code to do that in matlab..THANK you.
  1 件のコメント
Shameer Parmar
Shameer Parmar 2016 年 7 月 29 日
you need to first read the excel file each at a time and then apply the logic to delete the column whatever you want and then write the new data into either same file but in different sheet and then delete the old sheet and save the file..Else write the new data into new excel file and then delete the old file..

サインインしてコメントする。

回答 (1 件)

George
George 2016 年 7 月 28 日
You can use datastore() to read the files and the SelectedVariablesName to filter out what columns you want. Then save the associated variables with csvwrite() .

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by