Questions tagged [read-text]

44 questions
0
votes
2 answers

C# detect if line in file exists, before attempting to read substring

I want to read settings from a text file. string MySettingsFile = "Settings.txt"; Normally, the file would have 4 lines. SettingA:Alpha1 SettingB:Bravo2 SettingC:Charlie1 SettingD:Delta6 I want to get each line in it's own variable, like this…
CopalFreak
  • 53
  • 1
  • 2
  • 10
0
votes
1 answer

Unable to read a .txt zipped file with readtext in R

I have a zipped file containing Another folder with multiple text files It is structured like below: C:\DS\SUPERvised\**excerise.7z**\Data Science excercie \**Articles**\ The articles file has approximately 2000 text files I tried the below…
EricA
  • 339
  • 1
  • 12
0
votes
2 answers

Using textscan to extract values from a text file

I have the following text file: Leaf Tips:2867.5,1101.66666666667 2555,764.166666666667 2382.5,1221.66666666667 2115,759.166666666667 1845,1131.66666666667 1270,991.666666666667 Leaf Bases:1682.66666666667,800.333333333333 1886,850.333333333333…
ipunished
  • 664
  • 1
  • 6
  • 19
0
votes
1 answer

Automatically extracting Sections (and section Titles) from a file

I need to extract all subsections (for further text analysis) and their title from an .Rmd file (e.g. from 01-tidy-text.Rmd of tidy-text-mining book: https://raw.githubusercontent.com/dgrtwo/tidy-text-mining/master/01-tidy-text.Rmd) All I know…
IVIM
  • 1,363
  • 1
  • 9
  • 26
0
votes
0 answers

how to check if readtext fails to read part of a file

I am reading a text file with readtext(). It seems to be encoded in utf-8 (according to notepad++, am unable to verify); I am not sure if it is encoded correctly or if there are some mistakes/corruption. File size on disk according to windows…
user778806
  • 57
  • 5
0
votes
0 answers

MATLAB - create a loop to read from text variables and assign it to variables and then perform in matlab

I'm really new to Matlab and I'm currently working on it to create some matrixes. i need to write a loop that reads a text file then assign each set of integers to a variable with a certain number for example # of the row. after that it will…
Rana
  • 1
  • 1
0
votes
0 answers

Trouble reading content of .txt files in multiple subfolders into R

I have data of the structure: Main_Text Sub1_text Sub2_text Etc (I have several hundred subfolders) Each subfolder containers multiple .txt files. I want to read all of the files into R, to create a data frame that looks like this: Filename …
Rachel B.
  • 61
  • 1
  • 7
0
votes
2 answers

Reading tab-separated values from text file into array

Hey I am quite new to C++ and I am facing a problem: I have a textfile which looks like this: 500 1120 10 number1,1 number1,2 ... number1,500 number2,1 . . number1120,1 So the first two values on top of the text-file describe the…
kleman
  • 11
  • 1
-1
votes
2 answers

Determining the integers / lines between two given integers / lines

I have a large body of text that I am working with in r and I have identified the line numbers containing key text. I have these stored as two different objects: location1 and location2 I want to now create a list of the lines that fall between…
callivdw
  • 11
  • 4
-1
votes
0 answers

How to find a word in CMD Command Output C# Console App

Tough one for me here, trying to make a program that detects errors if errors occur when executing a command. What ive tried: if (cmd.StandardOutput.ReadToEnd().Contains("failed")) { Console.WriteLine("FAILED"); Console.ReadKey(); } else { …
HuskyPal
  • 1
  • 2
-1
votes
4 answers

How to read a .txt file and store it into an array

I know this is a fairly simple question, but I cannot figure out how to store all of the values in my array the way I want to. Here is a small portion what the .txt file looks like: 0 A R N D A 2 -2 0 0 R -2 6 0 -1 N 0 0 2 2 D 0 -1 2 4 Each value…
William
  • 39
  • 7
-1
votes
2 answers

Reading text in Linux shell and writing some specific rows to a new file

I have a file with information with this format (input.txt): 045002 1987244NDBC North L. Mich. 453086401 176 5 045002 1999140NDBC North L. Mich. 453186421 176 5 045002 2006117NDBC North L. Mich. 453386421 176 5 045002 2007127NDBC North L.…
-2
votes
2 answers

Star * delimiter txt file column is returning multiple times column value when stored in Array List

I have star * delimiter file that finally I need to store in the Array after splitting * delimiter where it is storing value in the array and printing column however it is continuously printing same column value again and again. Note: There are 60…
Curious
  • 282
  • 4
  • 19
-2
votes
2 answers

Java read a text file without quote marks

Text file is like "Name","Salary", "Bernard,"200000.00" BufferedReader br = new BufferedReader(new FileReader("file.txt")); String line = br.readLine(); String[] splitLine = line.toString().split(","); for (String splitValue: splitLine) { …
1 2
3