Questions tagged [file-read]

This tag can be used on questions about reading files.

To work with stored data, file handling belongs to the core knowledge of every programmer. One of the core file handling methods is reading a file.

Resources:

644 questions
-3
votes
4 answers

Need help to read specific line in a log which ends with specific word

I need help on java code to read a log file that can print all lines present ends with START word. my file contains: test 1 START test2 XYZ test 3 ABC test 2 START it should print test 1 START test 2 START I tried below code but it printing…
smriti
  • 1,124
  • 5
  • 14
  • 35
-3
votes
2 answers

How can I determine what I read from a file? Java

So I want to read a file, that contains numbers separated by spaces. For example, the file "try.txt" content is: 1 2 3 4 5 6 7 8 9 I know how to read this numbers and store them in an array with a Scanner, and two nested for loops.Ignore any…
AliAs
  • 93
  • 1
  • 1
  • 12
-3
votes
2 answers

Java - Reading a big file (few GB)

This question is very short. I have a file with a size of 4GB and at the moment I do read it with this code: public class Main { public static void main(String[] args) { byte[] content = null; try { content =…
Niton
  • 189
  • 4
  • 16
-3
votes
2 answers

Importing certain details from a 'txt' file

I have a .txt file where names and addresses appear in the following format: Sam, 35 Marly Road ... ... I want to be able to search Sam and for 35 Marly Road to come up. Here is the code I have so far: name = input("Please insert your required…
A.Yasin
  • 1
  • 1
-3
votes
2 answers

Text File to Lua Array Table

I need to transfer a text from a text file/string to a Table with a 2 positions vector. Like this: Text File: Gustavo 20 Danilo 20 Dimas 40 Table Names = {{Gustavo,20},{Danilo,20},{Dimas,40}} Need help to do this.
-3
votes
3 answers

Why segmentation fault in CODE 1?

Code 1: #include #include #include main(int argc,char **argv) { FILE *fp; char lineBuf[100],**p=NULL,temp[100]; int cnt,j,i; if(argc!=2) { puts("ERROR:Invalid no.of arguments"); …
Jhansi Rani
  • 449
  • 1
  • 5
  • 11
-4
votes
3 answers

Reading data from multiple text files

I am new to Java programming, I am trying to print names, read multiple text files from a folder and counting the word frequency of each word file, when i am reading a folder all the text files are printed but they are not read, please look at the…
sum2000
  • 1,363
  • 5
  • 21
  • 36
-4
votes
1 answer

What's wrong with this code in language C?

I study on an university and I got a task to do, and this needs to read a file in C. I'm very beginner in C and the teacher not so helpful, so I need someone other helps. What's wrong with this code: void main( ) { FILE *fp ; char ch ; …
Erix
  • 11
  • 2
-4
votes
1 answer

CSS file: I want to read css file from .aspx page

I am reading css file from aspx Login.aspx LoginWebForm
Mrunal
  • 111
  • 1
  • 2
  • 11
-4
votes
3 answers

How to use Python read a text file and transfer to dictionary?

1. How do you like this product? As someone who wears glasses for distance, but not contacts I have struggled with vision on the slopes At this price, I'm very happy with the B1. They were very comfortable I wore these all winter for 10 weeks of…
Boomshakalaka
  • 521
  • 1
  • 6
  • 19
-4
votes
1 answer

How to use data in a column to find average, max, min, etc?

I am trying to create a program that finds the max, min, average and the bmi of a data file. The file is 12 columns wide, however, I do not know how to use the data to create a bmi for each line? side note: I cannot use Pandas, I am required to…
-4
votes
2 answers

write array in python

I have a csv file that contains a list of data points. 1.3 5.0 15.35 14.3 9.8 4.4 7.6 9.87 How can I write a python program that can read the numbers in the csv file and make them into an array x so…
jms1980
  • 1,017
  • 1
  • 21
  • 37
-5
votes
2 answers

reading from a file using the input type=file in grails

Hi I have the following code in my grails gsp
Select the…
pri_dev
  • 11,315
  • 15
  • 70
  • 122
-7
votes
2 answers

Reading data from text line by line in java

I'm making a game in Java, but can't figure out how to get information from a text file so that I can load the game. I have the saved files set up so that on every line there is the name of a method in my Main program. What I need to do is to look…
hubbardh
  • 41
  • 6
1 2 3
42
43