Re: Spliting and creating small files from a main files based on line number

2015-03-25 Thread Jim Gibson
> On Mar 25, 2015, at 10:07 AM, Anirban Adhikary > wrote: > > Hi List > I have a configuration file and I would like to split the main file into > multiple small files and push the small temp. files into an array. My config > file looks like this > > GRC01;8;8;1;1;323U6_SIU-8;2048;2048;20;0

Re: Spliting and creating small files from a main files based on line number

2015-03-25 Thread Anirban Adhikary
Hi Sholmi I am using write mode for file writing because filename with counter value has assigned so there is no possibility of overwriting. What I would like to do i already said create some small file out of a main config file. IfI do not assign on $i then the for loop will not start from the n

Re: Spliting and creating small files from a main files based on line number

2015-03-25 Thread Shlomi Fish
Hi Anirban, On Wed, 25 Mar 2015 22:37:39 +0530 Anirban Adhikary wrote: > Hi List > I have a configuration file and I would like to split the main file into > multiple small files and push the small temp. files into an array. My > config file looks like this > > GRC01;8;8;1;1;323U6_SIU-8;2048;20

Re: spliting

2007-09-04 Thread Mahurshi Akilla
If you're trying to split a long string into smaller strings of 60 characters each, you can take a look at the substr function and build a loop around it. http://www.perlmeme.org/howtos/perlfunc/substr.html Mahurshi Akilla On Sep 4, 5:29 am, [EMAIL PROTECTED] (Pedro Soto) wrote: > Hi, > I have a

RE: spliting

2007-09-04 Thread Moon, John
-Original Message- From: Pedro Soto [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 04, 2007 8:50 AM To: Andrew Curry Cc: beginners@perl.org Subject: Re: spliting Well, Sorry if I was not clear enough. I want to read lines from a file and I need to split the line into characters. I

Re: spliting

2007-09-04 Thread Ken Foskey
On Tue, 2007-09-04 at 14:29 +0200, Pedro Soto wrote: > Hi, > I have a file with lines of 60 characters each. I would like to > split every line into its 60 characters, but there is not any delimiter > between them. Something like: ABCDEFGHIJK etc. > Is there anyway to do it? perldoc -f sysread re

RE: spliting

2007-09-04 Thread Andrew Curry
split(//,$string); _ From: Pedro Soto [mailto:[EMAIL PROTECTED] Sent: 04 September 2007 13:50 To: Andrew Curry Cc: beginners@perl.org Subject: Re: spliting Well, Sorry if I was not clear enough. I want to read lines from a file and I need to split the line into characters. I know you

Re: spliting

2007-09-04 Thread Pedro Soto
Well, Sorry if I was not clear enough. I want to read lines from a file and I need to split the line into characters. I know you can use the split function from perl to do this, but I have not space or commas or dots in between. So the file looks like(e.g): line1 ADCBFSDSSDDFFGTESDFGG line2 BG

RE: spliting

2007-09-04 Thread Andrew Curry
Just to clarify you have a file which is basically 1 string but you know every 60 characters is a new set of data? -Original Message- From: Pedro Soto [mailto:[EMAIL PROTECTED] Sent: 04 September 2007 13:29 To: beginners@perl.org Subject: spliting Hi, I have a file with lines of 60 char

Re: Spliting the log files

2007-08-29 Thread John W. Krahn
sivasakthi wrote: Hi All, Hello, I have used the following code to calculate from log files, #!/usr/bin/perl use strict; use warnings; use File::Tail; my $file=File::Tail->new("/log/path"); my $line= undef; You don't really need file scope for $line. while (defined($line=$file->read))

Re: Spliting some path

2004-04-13 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Saturday, April 10, 2004 12:56 PM Subject: Spliting some path > How can I split some path to directories > for example if my $path is "/home/ftp/some/file" > how can I get elements /h

Re: Spliting some path

2004-04-10 Thread Randy W. Sims
On 4/10/2004 12:56 PM, [EMAIL PROTECTED] wrote: How can I split some path to directories for example if my $path is "/home/ftp/some/file" how can I get elements /home, than ftp, than some, and for last - file I mean without split function, is there any other smarter way for doing it. because if

Re: Spliting comma delimited data

2003-06-09 Thread Janek Schleicher
Rob Anderson wrote at Mon, 09 Jun 2003 16:08:54 +0100: > I have the following code, which I intend to use to save/restore an array > to/from a text file with. > > As I'm using a comma to delilmit the data I'm escaping commas on the way > out, an unescaping on the way in. This means that when I sp

Re: Spliting comma delimited data

2003-06-09 Thread James Edward Gray II
On Monday, June 9, 2003, at 10:08 AM, Rob Anderson wrote: Is there some way to exclude the [^\\] part from being matched, err or something, help. my @restored_array = map { $_ =~ s/\\,/,/g; $_ } split(/[^\\],/, Try split /^(? That's only about my third ever "look-around assertion" though, so so

Re: Spliting a string on "."

2002-04-02 Thread Jeff 'japhy' Pinyan
On Apr 3, Rajeev Rumale said: >I am not able to split the the string "12.12.1975" on the "." seprator. > >also when I try ot repace the dot with some other variable useing the >statement $date=~s/./#/g; The character . is a special character for regexes. If you want it to match a LITERAL dot, y