Alice's Coffeelicious Idea - RDM 1 - Easy - 250 Points

Key Information

Register
Submit
The challenge is finished.

Challenge Overview

This is the easy problem of RDM-1 and carries 250 Points.
Here's the Match Leaderboard.

Problem Description

Alice is mad over coffee and she loves to try out each type of coffee. She becomes so addictive that she decides to open an online e-commerce website for premium coffee beans. To start with, she goes online and learns about various species of coffee available. She starts saving description of each type and starts writing it down in .txt files named like {SPECIES_NAME}.txt. For e.g. description of Arabica will be stored in Arabica.txt. For each type of species, she maintains exactly one text file.

She also keeps downloading images she comes across. All the images she downloads, contains the name of the species of the coffee separate by hyphen character -. For e.g. for arabica it can be something like 30sdfknl09123-arabica-23ij09d67as5123.png. It is guaranteed that the file names have only 2 - characters and she only downloads images for which she has already noted down the description in a .txt file.

She is so involved that she forgots to arrange her files. All of the files have been downloaded in the same folder. We need to help her rearrange the files like the following dirctory hierarchy in the same folder:

e-commerce/coffee/{species}/images/30sdfknl09123-arabica-23ij09d67as5123.png
e-commerce/coffee/{species}/about/desc.txt

where {species} is the name of the coffee species. All images are moved under images folder of the respective species folder and description is moved under about folder of the respective species folder with the name desc.txt

We need to provision her with an executable that helps her arrange the files.

File Samples (Accessible after you register for the challenge)

Input / Data Source

The executable will take a parameter -path which has the path to the folder where Alice downloads all her stuff.

Output

The executable will sort the files in the same folder itself according to the provided structure above.

Constraints and Guidelines

  • All file names are case sensitive depending on the underlying file system. For e.g. on Windows with NTFS file systems, file names are case insensitive, but on MacOS/Linux, file names may / may not be case sensitive.
  • The provided solution should be OS independent.
  • Alice only downloads .png files.
  • Please use the forums to ask any doubts.
  • We will judge your submission based on the requirements being fulfilled, so as long as the requirements are met, you would be rewarded with points for that particular problem.
  • Minimal code quality is expected, for the reviewer to review the submission and go through your code
    • Obvious and deliberate code obfuscation will be rejected.
    • Collaborating/Cheating in any way with anyone else (member or not) during a rated event is considered cheating.
    • An excessive amount of unused content should be avoided.
    • Code Readability is expected with necessary comments, indentation and somewhat refactored code (as much as possible)

Technology Stack

Whatever you feel like using.



Final Submission Guidelines

Your submission must be a single ZIP file not larger than 500 MB, with your executable file. 

ELIGIBLE EVENTS:

2021 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30144972