If you connect using Direct Query, when you publish it to Power BI Service it will be always up-to-date and refreshed. However Direct Query is not an option when the source is a text file. So, the only way is to use scheduled refreshes but that won't guarantee live data.
Thank you very much for responding. What options do we have for our real-time data scenario? My boss needs the data to be refreshed every 10 seconds, and the data source file should be a simple text file.