How do I remove first 5 characters in each line in a text file using vi? April 18, 2023 by Tarik :%s/^.\{0,5\}// should do the trick. It also handles cases where there are less than 5 characters.