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:

577 questions
3
votes
2 answers

With respect to ReadFile() WinAPI, GetLastError is throwing the error 183. What Does "ERROR_ALREADY_EXISTS" mean in this context?

I am calling ReadFile() WinAPI to copy the file contents to a char array, inside my VC++ code. Have placed GetLastError() immediately after ReadFile(). for( read some n no: of files) { FileRead(fp,destCharArray,ByesToRead,NoOfBytesRead,NULL); int…
codeLover
  • 3,557
  • 10
  • 56
  • 105
3
votes
2 answers

How to compare an ASCII value

I want to store the ASCII value of a letter into a variable, how can I do this? for example : r ASCII variable = 82 main() { character = "character read from a file"; variable= "r ascii"; //(in this case 82), the problem is that the letter…
XIIIX
  • 51
  • 1
  • 1
  • 4
3
votes
1 answer

Opening a .bsm file

I am trying to read the contents of a pascal.bsm file. What I am basically interested in is the system calls included in the file. I dont know how to open and read the file. The file I'm trying to read is here It is a file generated by a solaris…
ashokadhikari
  • 1,022
  • 3
  • 14
  • 28
3
votes
1 answer

Python: When reading files how to ignore the text between two specific words?

I am using pandas to read Excel files like this: My data file in the folder is like: df = pd.read_excel('Online_Trade_Record_' + str(Number) + '2021-01-19' + '.xlsx') But apart from the file generated in 2021-01-19, I also have other data files…
XaviorL
  • 309
  • 7
3
votes
1 answer

Read file in 8086 until the end of the file

MOV AH,3DH MOV DX,OFFSET(FNAME) MOV AL,0 ; 0 MEAN FOR READING PURPOSE ;OPEN INT 21H MOV HANDLE,AX MOV AH,3FH MOV BX,HANDLE MOV DX,OFFSET(BUFFER) ;READ MOV CX,30 INT 21H MOV AH,3EH MOV DX,HANDLE …
3
votes
1 answer

Erlang - search for a specific string within an external file and append file if not present

I want to check if a specific string is present in a external file,by reading the file line by line using erlang. If the specific string is not present ,I wish to append the file with the string. So far I have managed to open the file and read the…
3
votes
0 answers

Reading from a text file in python faster than C++

I am making a simple program that reads input from a text file then does some processing, it's written in Python. I heard reading from files is slow in Python and I do it periodically in my program so I thought I can use C++ for the file-reading…
Yosry
  • 97
  • 1
  • 7
3
votes
1 answer

Creating a lookup table in CHISEL

I am trying to create a lookup table in Chisel of width 72 bits and 1024 entries. These 1024 entries are stored separately in a file, which I read into my code. The code I have written so far is: import Chisel._ import scala.io.Source._ module…
titan
  • 122
  • 10
3
votes
4 answers

How do I read and append to a text file in one pass?

I want to check if a string is inside a text file and then append that string if it's not there. I know I can probably do that by creating two separate with methods, one for reading and another for appending, but is it possible to read and append…
multigoodverse
  • 5,876
  • 11
  • 51
  • 93
3
votes
3 answers

making windrose from my own data

I am trying to make a wind rose from a series of windspeed and direction values. I have an idea of how to write the raw program for doing this as shown below: from windrose import WindroseAxes from matplotlib import pyplot as plt import…
jms1980
  • 785
  • 1
  • 12
  • 31
3
votes
2 answers

How can I account for varying word lengths in a program that replaces words read from a text file?

I'm trying to replace words that are passed in with the word "CENSORED" but I can't figure out where to account for the difference between the replaced word and censored. Here's an example of the input and output. ./a.out Ophelia draw or
Sammy
  • 79
  • 5
3
votes
1 answer

PHP - Read and write the same file hangs

I'm trying to use FFMPEG to make some works with video on the server, and something I need to do is to get the progress of the process. I searched a little and I found this solution which tells to write the log into a file and then reading and…
Unapedra
  • 1,649
  • 2
  • 20
  • 33
3
votes
1 answer

Reading C Input with skipping commas and columns

I am new to C and i wanted to do File Read operations. Here i have input.txt which contains : (g1,0.95) (g2,0.30) (m3,0.25) (t4,0.12) (s5,0.24) (m0,0.85) (m1,0.40) (m2,0.25) (m3,0.85) (m4,0.5) (m5,0.10) now, i wanted to save k1,k2,k3 etc in array…
Kevin Yan
  • 65
  • 7
3
votes
1 answer

What is the entitlement to allow reading of file in a Mac OS X App? (deny file-read-data error)

I am making a Mac OS X App (sandboxed) which reads from an installed config file in /etc/myfolder. When I am trying to read the file using NSFileHandle, I am getting the following error in Console: sandboxd: ([3251]) MyApp(3251) deny…
MiuMiu
  • 1,875
  • 2
  • 18
  • 27
2
votes
3 answers

Can you read line by line in javascript?

Is there any way to read a file line by line in javascript, specifically this file which is a dictionary. I was trying to build a replica of a java anagram solver I made a few months ago, but hit this problem of not being able to read a file line by…
JasonMortonNZ
  • 3,652
  • 7
  • 32
  • 56
1 2
3
38 39