I want my Arduino UNO to read data from a .txt file

The Arduino needs to be running a program that will accept data from the serial port and carry out the appropriate commands. It has been done many times; here is an example: Simple Arduino command line interpreter · GitHub

The forum hosts a "Serial Input Basics" tutorial that may be helpful.