I have a document with carrots at the beginning of every line. The document is extremely long. How would I go about deleting the first character of every line in one quick command. I've looked through tons of VI documents and can't find an answer.
and i belave my syntax should be correct and look at the beginning of the line then look for a Carrot as the next charter. but if you want to get ride of all carrots in the file just use
:%s/ctrl+v//g
i am sure you can also use the tr (translate) utility if you wanted.
My humblest apologies.. I did not mean to include the "d"elimeter option within my solution to you. The person who wrote immediately after your response was correct. The command goes as follows:
You can use
:%s/ctrl+v//g
but with the g option it will remove all the occurences of the carrat from your document. If you want to remove the carrat only from the begining i.e only the first occurence then simply omit the g from the end of the command
:%s/ctrl+v//
the '-c 2-' is actually a range specification, on Redhat, I looked at:
"info cut"
this gave me more detail than the man page and it explained that the -c option is used with a range, ie '1-' is the same as '1-[end of line]' and so allows for dynamic line lengths. the same way that '-8' is equivelent to '1-8' so the range '2-' is actually from the second character in the line to the end of the line.