Using Substr and Regular expressions.



Hello,

I am attempting to take a string similar to the following as input:

response_93_johndoe_1171994965031.xml

and break it up into the following output:

93johndoe.txt

The format of the input will always be of the type
"response_<somenumber>_<somename>_<longstringofnumbers>.xml"

I would like this to be dynamic, such that I can run a perl script
from the command line, and it will take the above file name as input,
and give me the second name as output.

Any Ideas?

My Ultimate goal is to be able to create a log file based on the name
of the input file and store it as a variable to be used later.

Thanks,
Kent

.



Relevant Pages

  • Re: Multiple date formats in a Table
    ... a date field could not store just the year 2004 - it would have ... display it as 1 Jan 2004, or you would have to just display the year for all ... The conversion of your existing text format date should be done in a query, ... Public Function TextToDate(strDate As String) As Date ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Displaying dates in dd/mm/yy format
    ... the short date also contains time information. ... You can however format the string to shortformat. ... Can I somehow force Access to store the short ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: PEP proposal optparse
    ... Perhaps it is better to keep descriptions short and store longer ... as doing so ensure readability. ... help="date format string") ...
    (comp.lang.python)
  • Re: formatting problem
    ... I am trying to write to log file but the formatting of string is not ... private string LogLine (string logEntry) ... The format specifier will pad the second string ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: formatting problem
    ... I am trying to write to log file but the formatting of string is not ... private string LogLine (string logEntry) ... The format specifier will pad the second string ...
    (microsoft.public.dotnet.languages.csharp)