How can i Delete columns from many csv files?

2 visualizaciones (últimos 30 días)
sunil kusukuntla
sunil kusukuntla el 4 de Abr. de 2016
Comentada: Shameer Parmar el 29 de Jul. de 2016
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 comentario
Shameer Parmar
Shameer Parmar el 29 de Jul. de 2016
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..

Iniciar sesión para comentar.

Respuestas (1)

George
George el 28 de Jul. de 2016
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() .

Community Treasure Hunt

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

Start Hunting!

Translated by