+ Reply to Thread
Results 1 to 2 of 2

Thread: using calculations in scripts

  1. #1
    kvok is offline Newbie
    Join Date
    Jul 2009
    Posts
    1
    Rep Power
    0

    using calculations in scripts

    HI

    I have the following problem.
    I need to use split command to split files. Each should be cca 700 lines but i don't know how to implement it in the scripts because each time the original file will be various sizes.
    anybody have any idea

    cheers
    Last edited by xXHalfSliceXx; 07-28-2009 at 04:24 PM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    DarkLordoftheMonkeys's Avatar
    DarkLordoftheMonkeys is offline Programming Professional
    Join Date
    Oct 2009
    Location
    Massachussets
    Posts
    255
    Blog Entries
    56
    Rep Power
    11

    Re: using calculations in scripts

    I suggest you learn sed. sed will allow you to split files vary easily.

    For example:

    Code:
    $ sed "700q" textfile > first700lines.txt
    $ sed "1,700d; 1400q" textfile > next700lines.txt
    Life's too short to be cool. Be a nerd.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. need help with scripts
    By Artulo in forum PHP Development
    Replies: 5
    Last Post: 06-08-2011, 08:00 AM
  2. Calculations Using Pointers
    By Egz0N in forum C Tutorials
    Replies: 0
    Last Post: 06-08-2010, 07:36 AM
  3. Help with calculations using text boxes.
    By dionne in forum Visual Basic Programming
    Replies: 2
    Last Post: 02-18-2010, 07:00 AM
  4. Time/Date Calculations
    By dcs in forum C Tutorials
    Replies: 0
    Last Post: 10-19-2008, 10:00 AM
  5. large floating point calculations
    By zeos386sx in forum General Programming
    Replies: 5
    Last Post: 04-02-2007, 12:31 AM

Tags for this Thread

Bookmarks

Posting Permissions

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