Hi Payal,
These are the ways to read text files into R.
1. Comma delimited text file - use read_csv("path/filename.csv")
read_csv("file.csv")
2. Semicolon delimited text file - use read_csv2("path/filename.csv")
read_csv2("file.csv")
3. Text files with fixed space/tab - use read_fwf("path/filename.csv")
read_fwf("file.csv")
4. Partial text file (lines)- use read_lines("path/filename.csv")
read_lines("file.csv",skip,max,..)
5. Full text file - use read_file("path/filename.csv")
read_file("file.csv")
6. Any delimited file - use read_delim("path/filename.csv")
read_delim("file.csv",delim = "|")
hope it helps!