Hi, On 10 Apr 2013 11:30, "Chankey Pathak" <chankey...@gmail.com> wrote: > > Hi Kavita, > > You may try unpack (http://perldoc.perl.org/functions/unpack.html) > unpack would not work if the OP has varying length of lines.
> Also read these: http://www.perlmonks.org/?node_id=308607, > http://stackoverflow.com/questions/1083269/is-perls-unpack-ever-faster-than-substr > > > On Wed, Apr 10, 2013 at 3:46 PM, kavita kulkarni > <kavitahkulka...@gmail.com>wrote: > > > Hi All, > > > > I want to extract certain char sets (e.g. char 4 to 9, char 11 to 14 etc.) > > from each line of my file and store them in separate variables for further > > processing. > > My file size can vary from thousand to millions of lines. > > If I use perl in-built function substr() to data extraction, it has huge > > impact on performance. > > Is there any alternative for this? Please can you give example of what you want done and show how you are going about it? > > > > Thanks in advance. > > > > Cheers, > > Kavita > > > > > > -- > Regards, > Chankey Pathak <http://www.linuxstall.com>