Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

removing lines

 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

How do I remove (totally remove the entire line), whose first non-space non-tab chars are "</".

Such that:


becomes



Any existing editor who can do this? Or any steps or procedure to do it?
[ January 14, 2007: Message edited by: Jesus Angeles ]
 
author
Posts: 23908
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"vi" and it's variants can easily do this, with a "g/regex/d" command. Unfortuantely, it uses a variant of regular expressions that is different from the one provided in Java -- so you'll have to do a little research if you never used that editor before.

Henry
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there vi for windows? I saw unix when I searched. Thanks. I will look at it.

Another way is this, I just coded:

 
Henry Wong
author
Posts: 23908
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there vi for windows? I saw unix when I searched. Thanks. I will look at it.

Another way is this, I just coded:



Yes, there is a version for windows... but personally, I wouldn't go learn it just for one command. For editors, it is somewhat of an acquired taste.

BTW, if you went through the trouble of writing a program, then aren't you done? ... Also, with regex, the program can be somewhat shorter.



Henry
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic