I am trying to read a text file
by and extract the words from individual line to process.
I am not too sure how to use the streamreader
to read and process the text.
private async void readFile()
{
StorageFolder externalDevices = KnownFolders.RemovableDevices;
IReadOnlyList<StorageFolder> externalDrives = await externalDevices.GetFoldersAsync();
StorageFolder usbStorage = externalDrives[0];
StorageFolder Folder = await usbStorage.CreateFolderAsync(FolderName, CreationCollisionOption.OpenIfExists);
await usbStorage.GetFolderAsync(FolderName);
IReadOnlyList<StorageFile> FileList = await Folder.GetFilesAsync();
foreach (StorageFile file in FileList)
{
string Text = await FileIO.ReadTextAsync(file);
//StreamReader Text = new StreamReader(file);
//I am not sure how to implement StreamReader to read individual line of the text.
}
}
The file I am reading is show in the picture below. Please advise. Thanks.