Find the answer to your Linux question:
Results 1 to 3 of 3

Thread: split txt files

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Somwhere in India

    split txt files

    how do you split text or .c files in text mode

  2. #2
    There is a split command that breaks big files into smaller pieces?
    That what you mean?

    man split
    and see if that meets your needs.

  3. #3

    Re: split txt files

    Quote Originally Posted by nsm09
    how do you split text or .c files in text mode
    I use perl
    open &#40;SOURCE , "<mysource.c>"&#41;;
    open &#40;DESTINATION ">myresult.c>"&#41;;
    while &#40;$line=<SOURCE>&#41;
        print DESTINATION "$line";
    I write this code like that don't test it or even debug (not enough time right now (u see I'm just seeing I forgot to close my source and destination file)

    U could use sed but I don't know if u could use split as itself (I will test that and tell u if u want)

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts