Skip to content

Instantly share code, notes, and snippets.

View CPernet's full-sized avatar
:octocat:

Cyril Pernet CPernet

:octocat:
View GitHub Profile
@CPernet
CPernet / rename_brainvision_files.m
Created October 2, 2018 10:33 — forked from robertoostenveld/rename_brainvision_files.m
MATLAB function to rename all three files of a BrainVision EEG dataset. It also updates the details inside the files.
function rename_brainvision_files(varargin)
% RENAME_BRAINVISION_FILES renames a BrainVision EEG dataset, which consists of a vhdr header
% file, vmrk marker file and a data file that usually has the extension dat, eeg or seg.
%
% Use as
% rename_brainvision_files(oldname, newname, 'rmf', 'on')
% where both the old and the new filename should be strings corresponding to the
% header file, i.e. including the vhdr extension.
% 'rmf' option indicates to remove old files and can be turned 'on' of 'off' (default)