Closed Thread
Results 1 to 3 of 3

Thread: PERL - Split by Character

  1. #1
    Cosmet is offline Learning Programmer
    Join Date
    Oct 2006
    Posts
    58
    Rep Power
    0

    PERL - Split by Character

    Is there a way to split by character in perl?

    Say if I read a file and have only one line but I need to get 0-128 as one line, 129-256 as next, etc... Is there a way to do this?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest
    You will have to use the substr function to get all 128

    Code:
    @array_here;
    
    for ($i=0; $i<length(string);$i++) 
    {
        push(@array_here, substr(string,128*i,128);
    }
    Hope that helps.

  4. #3
    falco85 is offline Programmer
    Join Date
    Apr 2006
    Posts
    105
    Rep Power
    0
    Is perl still being used??

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 10-12-2011, 06:24 AM
  2. Wep Page Getting Split Up
    By supermandx in forum PHP Development
    Replies: 2
    Last Post: 09-11-2010, 12:24 PM
  3. Split Archive tar.gz?
    By Crop in forum Linux/Unix General
    Replies: 3
    Last Post: 01-15-2009, 07:33 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