CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
split function

 



perlnewer
Novice

Oct 12, 2010, 2:24 AM

Post #1 of 3 (1858 views)
split function Can't Post

871066-871069.doc


how to split this file into two files after '-' with .doc extension and insert into db?


tej.87g
Novice

Oct 13, 2010, 11:40 PM

Post #2 of 3 (1810 views)
Re: [perlnewer] split function [In reply to] Can't Post

Try this,

Probably this may help you..


Code
#usr/bin/perl 

my $file="871066-871069.doc";
my $file1;
my $file2;
if ($file=~m{(\d+)\-(\d+\.doc)}) {
$file1=$1.".doc";
$file2=$2;
}
print "$file1\n$file2\n";



perlnewer
Novice

Oct 14, 2010, 11:04 PM

Post #3 of 3 (1800 views)
Re: [perlnewer] split function [In reply to] Can't Post

thank u it's work fine

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives