Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Move file folder to a location you can write the path to easily (C: is usually a good choice, or the letter assigned to your external hard drive if the data are saved externally
  2. Open command line
  3. Change directory to file folder by typing cd path (e.g. cd C:\foldername\)
  4. Type dir > list.txt /b  and hit enter
  5. Open file folder
  6. Open the text file in a text editor and delete all lines that aren’t filenames
  7. Save and close
  8. Right click list.txt and click “edit with Vim”
  9. Type the following command and hit enter…
    :%g!/-HPF/d

...

  1.  
    Note: the following steps operate on the same column of characters in every line. If Vim starts a new line while you are typing in insert mode, delete what you’ve typed, press esc, and enter the following command before continuing

...

  1.  set tw=

...

  1. 1000 
    This command will change Vim’s settings such that each line can contain a maximum of 1000 characters. If that is not long enough, do the same command with a larger number. 
  2. Navigate to the top of the page. Click the first character at the top of the page.
  3. Type the following commands…
    Ctrl+q (+ as in press Ctrl and q at the same time)
    Shift+g
    Shift+i
  4. Type del path           (e.g. del C:\data\)        and press esc
  5. File>saveas>filename.bat (use .sh file extension if on mac. Don’t worry that .bat isn’t an option in the file type drop down menu. Simply changing the extension in the filename will change the filetype when saving in Vim.)
  6. Doubleclick filename.bat in file folder if windows. If mac, go back to command line and type bash: filename.sh
  7. That’s it! All of the –HPF files are now deleted

...

  1. Move file folder to a location you can write the path to easily (C: is usually a good choice, or the letter assigned to your external hard drive if the data are saved externally)
  2. Make a destination folder for –HPF files in C: (or the letter assigned your external hard drive)
  3. Open command line
  4. Change directory to file folder by typing cd path (e.g. cd C:\foldername\)
  5. Type dir > list.txt /b  and hit enter
  6. Open file folder
  7. Open the text file in a text editor and delete all lines that aren’t filenames
  8. Save and close
  9. Right click list.txt and click “edit with Vim”
  10. Type the following command and hit enter…
    :%g!/-HPF/d

...

  1.  
    Note: the following steps operate on the same column of characters in every line. If Vim starts a new line while you are typing in insert mode, delete what you’ve typed, press esc, and enter the following command before continuing

...

  1.        set tw=

...

  1. 1000 
    This command will change Vim’s settings such that each line can contain a maximum of 1000 characters. If that is not long enough, do the same command with a larger number. 
  2. Navigate to the top of the page. Click the first character at the top of the page.
  3. Type the following commands…
    Ctrl+q (+ as in press Ctrl and q at the same time)
    Shift+g
    Shift+i
  4. Type MOVE path (e.g. MOVE C:\foldername\)      and press esc The filelist should now say     MOVE path\file.extension       for every file

...

  1. (e.g. MOVE C:\data\ICLISTENHF1251_20140104T134650.097Z-HPF.wav)
  2. Repeat step 12
  3. Use arrow keys to move to the end of the first line
  4. Type spaceC:\newfoldername\       and press esc, where space is 1 hit of the space key. The file list should now say           MOVE path\file.extension newpath    for every file (e.g. MOVE C:\data\ICLISTENHF1251_20140104T134650.097Z-HPF.wav C:\data\HPFfiles\)
  5. File>saveas>filename.bat (use .sh file extension if on mac. Don’t worry that .bat isn’t an option in the file type drop down menu. Simply changing the extension in the filename will change the filetype when saving in Vim.)
  6. Doubleclick filename.bat in file folder if windows. If mac, go back to command line and type bash: filename.sh
  7. That’s it! All of the –HPF files are now in a different folder

...

Goal of Vim editing is to have a text document that reads…

del currentfilelocation\filename1.extension

del currentfilelocation\filename2.extension

.

.

.

del currentfilelocation\filenamelast.extension


OR


MOVE currentfilelocation\filename1.extension filedestination

MOVE currentfilelocation\filename2.extension filedestination

.

.

.

MOVE currentfilelocation\filenamelast.extension filedestination


Each line is a bash command that will delete that individual file or move it from its current location to the destination location. By using the visual block functions of Vim, we can write this command for every individual file without having to type it out as many times as we have files, and save the document as an executable file so that command line will execute each line in succession.

...

“Directory print filename.extension /bare (no additional info other than filename)”


Step 8.

:%g!/-HPF/d

“start command global opposite / lines containing “-HPF” / delete”

...

If at any point in Vim you make a mistake or get stuck…stuck… 
You can click edit>undo to undo a command
You can press esc to get out of different editing modes

...