VIM question - script to remove 1st two characters from each new line

Posted on 2007-07-31
Last Modified: 2013-12-13
I am using VIM 7.1 on WXP to make some alterations to a file that is almost 3MB in size.  I did remove all asterisks from the file using a global search and replace (%s/*/ /g), but now I need to remove the first two characters from each new line in the file (beginning at a certain point, because I tried to do a couple hundred lines manually).  Sometimes the first two are blank spaces, sometimes they are some very funky characters.  New lines are showing up as ^M in my file.

Is there a simple script I can write and run to accomplish this?
Question by:kbdaemon
    1 Comment
    LVL 84

    Accepted Solution

    will replace starting from the current line

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now