This tag refers to the process of writing text or data to a file.
Questions tagged [file-writing]
932 questions
2
votes
2 answers
Issue with Jmeter Beanshellcode for file writing
I am currently working on a jmeter JDBC scripts which involves executing huge queries on the DB to setup data for test.
Its a bit of a complex script where I need to validate and extract specific filed from the result set and then write it all in…

Pankaj Harde
- 55
- 1
- 11
2
votes
1 answer
GlobalScope.launch doesn't finish its task inside runBlocking main function
I don't understand why in the program below GlobalScope.launch instruction doesn't finish its task.
I do understand that runBlocking has no control over GlobalScope and it's usually bad to use it, but that doesn't make me know why instructions…

HaKIM
- 23
- 4
2
votes
1 answer
Python calendar with pandas (basic level)
Hi I'm trying to make a schedule for one year where I want to write a textfile containing every single day with information of activities. The code is WRONG but I need help with changing it so that I does want I want it to do.
import pandas as pd
a…
user14638035
2
votes
1 answer
Python CSV, How to append data at the end of a row whilst reading it line by line (row by row)?
I am reading a CSV file called: candidates.csv line by line (row by row) like follows:
import csv
for line in open('candidates.csv'):
csv_row = line.strip().split(',')
check_update(csv_row[7]) #check_update is a function that returns an…

Pro Girl
- 762
- 7
- 21
2
votes
1 answer
Write to file in uwp that has been drag-dropped from explorer
If file is dragged and dropped from file explorer it has FileAttributes.ReadOnly flag for StorageFile.Attributes parameter. In that case using StorageFile api to write to file will give error. How to write to file in this case??

Soumya Mahunt
- 2,148
- 12
- 30
2
votes
1 answer
remove all the EOFs (extra empty lines) at the end of jsonl files
I am working with jsonl files that look something like this in VSCode editor:
first.jsonl
1.{"ConnectionTime": 730669.644775033,"objectId": "eHFvTUNqTR","CustomName": "Relay Controller","FirmwareRevision": "FW V1.96","DeviceID":…

AOE_player
- 536
- 2
- 11
2
votes
1 answer
How to write function's output on multiple line in Node.JS
I want that my function write multiple lines in a text file but there is only one. I tried to make a loop but nothing changed. Please, help.
Here's my code:
const prompt = require('prompt-sync')();
const num = prompt('myquestion : ');
let path =…

Clément Bonnafous
- 23
- 1
- 5
2
votes
1 answer
Problem getting Java to write logs to file
I am very new to java and coding so please understand that I am very naive when it comes to this stuff.
I am trying to get Java to write logs to a .txt file. I have been researching this for hours and my brain hurts too much to keep looking. I am…

Smith Nicky
- 23
- 3
2
votes
1 answer
Writing files concurrently with other cpu-bound tasks with multiprocessing or ray
I have a workstation with 72 cores (actually 36 multithreaded CPUs, showing as 72 cores by multiprocessing.cpu_count()).
I tried both multiprocessing and ray for a concurrent processing, in batches of millions of small files, and I would like to…

Wall-E
- 623
- 5
- 17
2
votes
2 answers
How to write a list of classes to a file in UWP C#
I have attempted to use the methods on this thread by deadlydog:
How to quickly save/load class instance to file
This works in a console application for writing a list of classes to a file. However when I try migrating it to a UWP project I always…

DavidSNB
- 171
- 1
- 10
2
votes
2 answers
Python 3 Input: Text file manipulation requiring loops, splitting, string indexing and 'r', 'w' , 'r+'
I am a beginner with python and I am unsure what I should be searching for with regards to my assignment. I am trying to find a way to manipulate a text file to the output format required.
The question is as…

Nicole_9026
- 33
- 5
2
votes
1 answer
How to apply function row by row, and save csv at each step (append)?
I'm using following script (Python 3) with the intention to
apply a function row by row and
write each resulting line into a csv.
More precisely, I just like to append each row to the existing file.
Code:
with open('file.csv', 'a') as f:
…

Christopher
- 2,120
- 7
- 31
- 58
2
votes
3 answers
Weird behavior in struct destruction
I am trying to write a struct to a file and read it back. The code to do so is here:
#include
#include
#include
using namespace std;
struct info {
int id;
string name;
};
int main(void) {
info adam;
adam.id…

eager
- 53
- 1
- 5
2
votes
2 answers
How can I efficiently write the (700,000 lines) content from a For-loop into a file efficiently from Java?
I wrote following code to fetch the results in form of XML responses and write some of its content to the a file from Java. This is done by receiving an XML-response for about 700,000 queries to a public database.
However, before the code can write…

PinkBanter
- 1,686
- 5
- 17
- 38
2
votes
1 answer
Write csv columwise
I have a list of lists example:
list_of_lists = [['name1', 'number1', 'comment1'], ['name2', 'number2', 'comment2'], ['name3', 'number3', 'comment3']]
I want to write them into a csv file that should look like this:
NAME NUMBER COMMENT
name1…

Akshay Jagtap
- 47
- 9