Here is a solution sketch.
To make this usable as a future assignment, I have removed
all semblence of comments, error checks, and have not done a separate
implementation.
However, you can see the basic algorithms at work.
Here is the test program.
You may not alter it in any way.
Here are the first few lines of output:
Middle removed is 6
Only unremoved is 12
(Removal order) Collection contains: 11 items
1 2 3 4 5 6 7 8 9 10 11
In reverse:
11 10 9 8 7 6 5 4 3 2 1
Comments: Command #2 will work as long as you have correctly handled
the case of having no filename. The processing of the < will be
handled by the operating system, and not by your program.
The last two commands should generate errors. The others are
all legitimate.