Question: Task For this challenge, your task is to read a text file containing lists of filenames with extensions and determine which names are unique per

Task

For this challenge, your task is to read a text file containing lists of filenames with extensions and determine which names are unique per row, ignoring the file extensions.

For example, consider the following text file:

foo.mp3|bar.txt|baz.mp3 wub.mp3|wub.mp3|wub.mp3|wub.txt|wub.png quux.mp3|quux.txt|thud.mp3

The expected output for this file is

foo.mp3|bar.txt|baz.mp3 thud.mp3

After removing extensions, all three names are unique on line 1 so the entire line is unchanged.

However, after removing extensions on line two, all wub files aren't unique and therefore are not included in the output at all.

For line three, after removing extensions, files with the name quux are non-unique and are removed from the output. thud.mp3 is unique and is included in the output. Notes

Filenames in the text file are strictly alphanumeric with a single period. No paths are involved. The delimiter is always a pipe. Each line should be operated on independently from all others; no logic carries forward from line to line. Files won't be more than 500 lines and lines will never be longer than 100 characters. You can consult outside resources and use any utilities available on the code runner but the solution must be your own work.

Rubric

You'll be evaluated on passing all of the submission tests and on solution code quality.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!