This tag refers to the process of writing text or data to a file.
Questions tagged [file-writing]
932 questions
-1
votes
2 answers
error when writing to a text file in python [I/O operation on closed file]
I wanted to make a file in python and i came across a error. i have no idea why it comes up with this, i did look online but couldn't find any solutions to my problem. and i have imported random and i do have a list for enc1
f =…

theRumblers100
- 81
- 1
- 2
- 5
-1
votes
3 answers
Wrong CSV printing in Python (enumerating numpy array)
I apologize if this question looks like a duplicate. I am trying to write a 7x2 array to a .csv file. The array I want to print is called x5:
x5
Out[47]:
array([[ 0.5, 1. ],
[ 0.7, 3. ],
[ 1.1, 5. ],
[ 1.9, 6. ],
…

FaCoffee
- 7,609
- 28
- 99
- 174
-1
votes
1 answer
Why is the file being overwritten?
I'm designing a new server application, which includes a subroutine that parses the input into the console window, for example
LogAlways("--- CPU detection ---")
will be written as:
[net 21:8:38.939] --- CPU detection ---
This is the…

AStopher
- 4,207
- 11
- 50
- 75
-1
votes
3 answers
System.IO.IOException creating File
I have an Error if I write something in a newly created File.
This is my code:
private void ButtonClick(object sender, EventArgs e)
{
Button b = (Button)sender;
string inputKey = b.Text;
for (int i =…

xDropzZ
- 1
- 1
-1
votes
1 answer
How do I store a string (name) against 3 corresponding integer values (scores)
I'm trying to write a program that will store the results from a quiz against a player's name. I need to always have a record of the past 3 attempts against the users name. I need to be able to store these results for an indeterminate number of…

D McKenna
- 5
- 2
-1
votes
1 answer
Writing value just once to file in for loop
I have this iteration:
with open("myFile.txt", "r") as landuse:
next(landuse)
for j in landuse:
landuseList = j.split(";")
clcKlasse = landuseList[2].strip()
landusePlz = landuseList[3].strip("\"")
landuseArea…

four-eyes
- 10,740
- 29
- 111
- 220
-1
votes
1 answer
How to Select Recurring Text in a File
I'm Writing a code, where the user can input one option out of a multiple choice selection. Whatever answer they give, such as "a" or "b", gets written as either "Correct" or "Not Correct" into a separate text file, (StudentAnswers.txt).
Obviously,…

Ash
- 25
- 4
-1
votes
2 answers
Write to a ruby file using ruby
Alright, so what I have is a ruby file that takes an input, and writes it to another ruby file. I do not want to write it as a text file, because I am trying to insert this item into a Hash that can later be accessed in another run of the program,…
user4826496
-1
votes
1 answer
fopen error in PHP
I seem to be having some issues with my code, particularly with the fopen() command.
Is this the correct way to write images to a file? Would I also need to include r if I want to read from that image file later?
Here is what i have.
$boiler_img =…

Ph33ly
- 663
- 3
- 13
- 29
-1
votes
1 answer
Counting into an array and writing to text file xcode
Hi I am trying to count in note data from keyboard and write the data to a text file which will subsequently be read out of and played back as notes.
I seem to only be able to write one line of numbers to the text file and help would be most…

Mikey O'Keefe
- 3
- 2
-1
votes
1 answer
Writing to text file error
Hi I am working on a program to store some files to a text document that can be reloaded when necessary. Below is the beginning of the code however when run I receive a trace back error stating "recipe_title is not defined" when I thought I had…

Alan Walters
- 11
- 2
-1
votes
2 answers
openFileOutput throws NullPointerException (And i dont know why)
So, I am porting my IRC Bot to run on my Tab, which uses 4.4.2 (API 19)
The function that is giving me problems for the last day now is the Quote Database, which adds quotes by users and stores them into files - they can be retrieved and displayed.…

Scriver
- 11
- 1
-1
votes
1 answer
How do you instantly update an XML document after you add a node to it?
So I'm making a calendar program and I need it to update when you add a new entry to it. Right now, I need to click on the xml file to get it to update, then everything else works fine.
Declaration:
private DocumentBuilderFactory…

alexanderd5398
- 332
- 1
- 4
- 16
-1
votes
1 answer
How to write/read and manipulate microsoft access databases
I was wondering how i could easily read and write to Microsoft access files.
I have to be able to create and write to it with 2 variables(depending on inputs during the program) and then if this person repeats this more than 3 times it must only…
-1
votes
1 answer
Writing data from multiple list box into excel columns in c#
I have a windows form application in c# where there are list of data in multiple listbox (around 56 in each listbox).
here is an example:
listbox1 contains data of name of students
listbox2 contains data of address of students
listbox3 contains…

kamal pandey
- 11
- 3