spliting the file

Posted on 2005-05-02
Last Modified: 2010-03-05
split -n filename always spitts the file into 3 files

how can i split  the file into 2 files


Question by:shahrahulb
    LVL 6

    Accepted Solution

    its depends on the file length,
    AFAIK, each 100 lines make new file
    since you get 3 , you have 201 to 300 lines

    split -l 150 filename, will give you 2 files

    to have it all time 2 files, it's lightly complicated (use 'wc -l filename' and devide it by 2)
    i.e, file with 15000 lines, split -l 150 filename , will give 100 files
    LVL 16

    Expert Comment

    Why does this question appear in the Perl TA??

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    734 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

    25 Experts available now in Live!

    Get 1:1 Help Now