Sed
delete all lines that do not start with a certain string
sed '/^your_string/!d' input_file > output_file
add a certain string to the beginning of each line
sed 's/^/your_string/' input_file > output_file
add the string sample to the beginning of each line
# vim
:'<,'>s!^!sample!