Read data from file

Hi everybody !
I have problems when read content file and assign to String.
Now i have a file “products.txt” with content " 1|MSI|5000".
i have a “String txt;”
now i want txt = 1|MSI|5000. ( it’s content of file products.xt ).
i try but have problems something like CORS., require not define,… so on.
i’m sorry my english not good ! thank you !