Hi, folks
I have a file like this
------------
REM aaaaa
REM bbbb
ccccccc
------------
In vi, or in perl, whatever it works, how can I remove all the lines start
with REM?
Thanks for your help
I have a file like this
------------
REM aaaaa
REM bbbb
ccccccc
------------
In vi, or in perl, whatever it works, how can I remove all the lines start
with REM?
Thanks for your help
I am sure you will get great complicated answers. Here is my grep versionQuote:> Hi, folks
> I have a file like this
> ------------
> REM aaaaa
> REM bbbb
> ccccccc
> ------------
> In vi, or in perl, whatever it works, how can I remove all the lines start
> with REM?
> Thanks for your help
grep -v ^REM file_original > file_new
> I have a file like this
> ------------
> REM aaaaa
> REM bbbb
> ccccccc
> ------------
> In vi, or in perl, whatever it works, how can I remove all the lines
> start with REM?
:g/^REM/d
vi: g/^REM\s/dQuote:>In vi, or in perl, whatever it works, how can I remove all the lines start
>with REM?
notes:
by default these commands are case-sensitive.
drop the \s if lines like `REMxxxx' should also be deleted.
your vi may not grok \s, in which case you can replace it with `[ ^I]'.
`^I' should be interpreted as a single `tab' character.
--
bringing you boring signatures for 17 years
I wonder how much homework we're doing for people here..Quote:> in comp.unix.questions i read:
> >In vi, or in perl, whatever it works, how can I remove all the lines start
> >with REM?
> vi: g/^REM\s/d
> perl: perl -i -n -e 'print unless /^REM\s/' file
> notes:
> by default these commands are case-sensitive.
> drop the \s if lines like `REMxxxx' should also be deleted.
> your vi may not grok \s, in which case you can replace it with `[ ^I]'.
> `^I' should be interpreted as a single `tab' character.
--
Dan
lots.Quote:>I wonder how much homework we're doing for people here..
--
bringing you boring signatures for 17 years
Yes probably. But i dont think its bad that we help them with theseQuote:>>I wonder how much homework we're doing for people here..
> lots.
When they see the answer to their question they realize that
they asked a not-so-bright thing.
1) They will see that there is solution to their 'impossible' problem.
2) They will see in the answer that it was not hard to come up with
for the 'provider'.
3) They come to realize that they could have done it by them self, so
when the next question comes up they will try a minute more before
they give up and cry for help :)
Well, that is what i would like to think is going on anyway. Perhaps
im naive.
Actually, i dont care since i make a dollar out of it anyhow.
Thinking up solutions for these question is helping me more than
it helps them. It helps me to wrap up these basic skills in concrete.
Very useful!
Gradually one will build up skills, and at some point
some questions will be to easy. Just leave them for the 'younger-
generation-newbie-helper' to answer.
Its a win-win situation. Although one wonders about some questions though :)
//Mats
1. Need help with VI, is there a VI news group?
Thanks,
Anthony
3. Help with vi/X (newbie question, sorry)
4. TV not working, here's the error:
6. The process that wouldn't die
7. why doesn#t "set -o vi" enable vi style cmdln editing?
8. UNIX utility to process VMS save sets
9. how do i get VI to handle multibyte chars (VI on a PC)
10. Can I make tcsh "vi" bindings more like ksh "vi"?
11. vi, oh vi, must I suffer so?
12. vi editor FAQ (Frequently Asked Question List), Part 1/2
13. KORN VI and .exrc question