Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7025135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:56:04+00:00 2026-05-27T23:56:04+00:00

Scenario : Our customer is has provided us with files whose names contain an

  • 0

Scenario:

Our customer is has provided us with files whose names contain an ID number that we need for indexing purposes.

.\root\dir1\a123.txt (ID is 123)

.\root\dir2\abc345.csv (ID is 345)

.\root\dir3\235.xls (ID is 235)

we know what format to expect based on the files location and extension. Our customer would like to be able to add

.\root\dir4\foo556.bar (ID is 556)

meaning we cannot write a custom method for each entry under root.

My Solution:

The solution we are thinking of is to store the formats of the file names in an XML file

<root>
     <entry>
          ...
          <format>abc###</format>
          ...
     <entry>
<root>

when the customer want to add a new entry under root they’ll have to give a directory, a file extension and a format. Then on our end implement a getID() method that is able to use the format specified in the XML to retrieve the IDs from the file name.

Question:

Has anyone else dealt with a similar situation? If so is there a better solution than the one I have provided?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:56:04+00:00Added an answer on May 27, 2026 at 11:56 pm

    Assuming the file name will always be on the form <letters><digits>.<extension>, I would use a simple regular expression to match the relevant part of the name. E.g. .*\\[a-z]*\([0-9]*\)\..* (may vary depending on the RE engine in question).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my scenario: Our big customer demands that we should develop a part
Our scenario: We have a main database that stores company-wide information. We have several
I have the following scenario: A user on one our customer's website clicks a
Our current scenario is like this: we have an existing database that needs to
An issue that has come to light is to open up our application (we
here is my scenario our team develops on AIX dozens of applications, mostly Perl,
Here's our scenario: We've created a sharepoint 2007 calendar on our intranet site We
Good Morning SO! We've been scratching our heads with with this interesting scenario at
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.