Entering edit mode
4.2 years ago
paramount.amin
•
0
Hello Everyone
I have a folder, consist of 15000 separate CSV files. All of these csv files have the same heading ( date, time, event,...). I want to remove the event column in all of my csv files. How can I do that?
Thank you
Awesome!
1-How can I remove two or more columns like event, time, ...?
Thank you so much
Alex Reynolds gives a great explanation in his reply if you choose to use the cut option. For the R option you can change
DT[, event := NULL]
toDT[, c("event", "time") := NULL]
to remove as many columns as you wish.EDIT: Alex's post seems to have disappeared so I'll expand on cut a little bit. The part of cut that lets you select columns is the
-f1,2,4-
part. For that example you select the first, second, and fourth and above columns.-f1-5
would select columns one through five.-f2-5,7-
would select columns two through five, and then columns seven and above.Thank you for your prompt and great answer to this problem. I really appreciate it