|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
parse filenamesby esolm (Acolyte) |
| on Apr 12, 2002 at 12:32 UTC ( [id://158622]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.esolm has asked for the wisdom of the Perl Monks concerning the following question:
Oh Wise Ones, I have a dir filled with files. Each file contains tab-delimited data that will ultimately be loaded into a database. The files each have a number as their suffix (ex. FILE.001, FILE.002, etc.) The data inside the files contain no reference as to which file the data came from. I wrote this little program that takes the filename and places it at the end of each line of data contained in the file. This works fine and solves the problem. The improvement I would like to make is instead of taking the entire filename I would like to take the suffix only (i.e. 001, 002, etc.). Looking at the code provided what would I have to add to just get the text after the period (.) in $file variable. Thanks in advance for your help, Eli
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||