skip to Main Content

I have a large data set with 3 columns that looks something like this

example:

user,message,time
user ,message ,12:00

how do I remove the entire time column?

I want it to be

user ,message

Thanks

I tried to multicursor but I can’t figure it out

3

Answers


  1. Open your dataset file in Visual Studio Code.

    Place your cursor at the beginning of the first column of the time data (in this case, the "time" header).

    Hold down the Alt key (Option key for macOS) and click on the first cell of the time data. This will create multiple cursors at each occurrence of the time data in the column.

    With all the cursors in place, press the right arrow key to select the entire column of time data.

    Once the entire column is selected, press the delete key to remove it.

    Login or Signup to reply.
  2. Use a Regex Find and Replace

    find: ^([^,]*,[^,]*).*$

    replace: $1

    Login or Signup to reply.
  3. If the column is totally aligned throughout the whole file you can do a box selection and delete. Click on top left corner of column, then press Shift+Alt, click and hold from top left corner to bottom right corner to select, then you can press Del to delete.

    If the column is not aligned then you’ll need to use something like sed, or awk, or cut in the shell to parse through the values on each row and discard that column.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search