file-handling is an abstraction of common actions such as creating, opening, closing, reading, updating, writing, comparing and deleting files
Questions tagged [file-handling]
2915 questions
0
votes
1 answer
PyCharm's "Search Everywhere" does not show filename extensions
I am working with PyCharm on a Mac and for some reason, it does not show filename extensions for certain file types when I'm using the "Search Everywhere" functionality.
As you can see in this example, the file ending .txt for requirements.txt is…

Alexander Pacha
- 9,187
- 3
- 68
- 108
0
votes
1 answer
How do I read each record in the input file as inputFile.read(reinterpret_cast (&s1), # of characters)?
I'm currently writing a program that needs to read a input file and populate a set of Student objects. Then it will display the objects, and perform some basic loop and function-based processing. I'm still new to C++, especially with file handling…

Orion98
- 91
- 6
0
votes
1 answer
Displaying all data stored in file is showing an extra data,using loop in C++ File handling
I am making a contact management system on console. I am at beginner level. I have stored data in file using file handling[class : newContact, function : void newcIn (in my code)]. When i display all data stored in my file, it shows an extra entity.…

Mistr Harry
- 3
- 2
0
votes
1 answer
How do I write the scores of my game into the leaderboard.txt and display the top 5 scores only with each player's name
I'm currently doing a dice game for my school programming project, and it includes the rules: 'Stores the winner’s score, and their name, in an external file' and 'Displays the score and player name of the top 5 winning scores from the external…

perfect.
- 1
- 1
0
votes
4 answers
read microsoft word document in java
is there a simple way of reading a microsoft word document in java without using Apache POI package?
Or what are other alternative to achieving the same without using Apache POI package?

StackTrace
- 9,190
- 36
- 114
- 202
0
votes
1 answer
Javascript API / filehandling in a simple way for an amateur?
function sende(){
var host = document.getElementById("Host").value;
var name = document.getElementById("ID").value;
var pw = document.getElementById("PW").value;
var at = document.getElementById("AT").value;
var sub =…

Lisa
- 1
- 4
0
votes
4 answers
Is there a way to add some text in between a file without overwriting any existing content of the file using FileChannel
Let's say I have a txt file:Hello World
I want to just add "My" in between so that the file looks like this:Hello My World
I was trying to achieve this using java.nio.channels.FileChannel class as you can seek the file pointer.But when I move the…

Royston Furtado
- 21
- 3
0
votes
2 answers
Why is open() returning an empty variable?
I have a text file containing a list of names and job descriptions, for example:
Jim Salesman
Dwight Salesman
Pam Receptionist
Michael Manager
Oscar Accountant
I wanted to add the names and jobs of the persons who are "Salesman" to a list. But at…

Edward Styles
- 3
- 1
0
votes
1 answer
Aspose Cell FileNotFoundException: EROFS (Read-only file system)
I get that error in the title when saving the excel file to pdf. This is in Android by the way. My code is basically like this:
Workbook workbook = new Workbook(filePath);
workbook.save(“MyPdf.pdf”, SaveFormat.PDF);
The filePath is a string that…

Junn Dobit Paras
- 25
- 6
0
votes
3 answers
finding string in .txt file and delete it
i write folder content (files wit .pdf .doc and .xls) in a small txt file. every filename get a new line in the txt file. Works fine.
Now i want to remove all line with the .pdf files.
I still use the following code to remove false entries (fail.png…

0x01_PH
- 126
- 10
0
votes
1 answer
Loading data into shared memory
I want to know how to load data from a text file into shared memory in C or C++. I want to assign the content of the file into structs line-by-line, like:
name: gaimi dancer
id: 443432
address: 123 Southbrook Dr. Mombai, In
PhoneNumber:…

Love69
- 111
- 1
- 1
- 4
0
votes
2 answers
How to make my code read input from a file for an arbitrary number of floats?
I have written a code in c that reads numbers from a text file and puts them into a matrix format in an array. The thing is I have made my code work for a matrix of definite size 3x3. If I have to increase the size, I have to directly change it in…

Shashank Saumya
- 11
- 2
0
votes
1 answer
Read from file and add to dictionary without lists
Thie is an example of my text file:
A, 100 101 102
B, 103 104
I want to read from this file and create a dictionary.
Here is my code:
def readFromFile():
d = {} # empty dictionary
with open('file.txt') as fr: #read from text file
for line in…

Mardhiah Hamid
- 5
- 2
0
votes
3 answers
python file-handling formatting
Please help, I have a dictionary which I need to write to a txt file I need to change the formatting of the dic so that when I write to new file I can get the desired output below. Thanks!
my dict:
sdata = {'A': [1, 2, 3, 4], 'B': [128, 118], 'C':…

Janice goh
- 17
- 6
0
votes
0 answers
How do change the default directory for file creation?
i have been using visual studio for programming and i want to change the default directory when i create a new file of any type with c++. However , is there a way where i can specify where a file should be placed in my project.
for eg:
#include…

kartik30369
- 1
- 2