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 doctor id from file name

 



padmahealthsoft
New User

Aug 25, 2010, 4:52 AM

Post #1 of 3 (2298 views)
Split doctor id from file name Can't Post

Hi

I am new to Perl.In my project Perl script used for download medical transcription files from client to our server.downloaded files automatically allotted to transcriptionst using Perl.my problem is how to split the doctor id from that files and how to check if particular doctor files are came and allotted that files to particular users.how to do that?i.e file name = N 0824-003 908000000 02 237144 .vox .in that 9080000 is doctor's id.
kindly help me.


(This post was edited by padmahealthsoft on Aug 25, 2010, 4:57 AM)


Zhris
User

Aug 26, 2010, 9:58 PM

Post #2 of 3 (2238 views)
Re: [padmahealthsoft] Split doctor id from file name [In reply to] Can't Post

hey,


Quote

check if particular doctor files are came and allotted that files to particular users.


I'm unable to understand what you meant here. Also I think the doctor id you provided was 2 0's short of the actual doctor id?

In regards to splitting the filename to retrieve the "doctor id", you could simply use the split function:


Code
   
my $filename = 'N 0824-003 908000000 02 237144 .vox';
my ($part1, $part2, $doctorid, $part4, $part5, $extension) = split /\s+/, $filename;
print "$doctorid\n";


Chris


(This post was edited by Zhris on Aug 26, 2010, 10:01 PM)


rayapallisuresh
New User

Dec 14, 2010, 11:07 AM

Post #3 of 3 (1758 views)
Re: [padmahealthsoft] Split doctor id from file name [In reply to] Can't Post

to split the doctor id from a string like
my $string = "N 0824-003 908000000 02 237144 .vox"

code:
my $doc_id = ( split(/\s+/,$string) )[2];

logic:
take the third element of the list returned by split in list context.

 
 


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

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