This tag refers to the process of writing text or data to a file.
Questions tagged [file-writing]
932 questions
2
votes
0 answers
What will happen to the file when nodejs process crash during the writeFile?
If the Node.js main process crash during the fs.writeFile operation, My questions are:
What will happen to the file?
Will the write action stop, and cause just do half write?
If the write flag is 'w', will the file store just half data?
How can I…

zaraguo
- 21
- 4
2
votes
1 answer
How to rollback file writes when using Apache Camel transaction?
I am using a multicast route in Camel with two pipelines.
One pipeline adds the data into database and other does some write operations on a file.
My requirement to rollback the complete process in case of failure or any error.
I have successfully…

KayV
- 12,987
- 11
- 98
- 148
2
votes
2 answers
writing or printing line by line to a text file from a get text field string
I understand that my question might be repeated, but I couldn't find the answer I need in other question's answer,
I have a textArea where some data was appended there.
and I want to write that data into a file with the same style of lines as in the…

Aboelmagd Saad
- 69
- 7
2
votes
1 answer
how to write results of CRF++ tool in a file
I am using CRF++.
The following command is used for testing:-
crf_test -m model_file test_files
There is no option to write results on file. While we need results on separate file.

Hamada Ali
- 65
- 5
2
votes
1 answer
Golang: file.Seek and file.WriteAt not working as expected
I am trying to make a program which writes at provided offsets in the file, like i can start writing from 20th offset etc.
here is one of sample code i was using as reference
package main
import (
"fmt"
"io/ioutil"
"os"
)
const (
…

Abhishek Soni
- 1,677
- 4
- 20
- 27
2
votes
0 answers
Unable to write to file in Swift, program "can't find directory."
I have a simple program, meant to write a short string to a file on the Desktop. It consists of the following code:
let path: String = "~/Desktop/test.txt"
let text: String = "This works!"
if let dir =…

Suleiman
- 63
- 3
2
votes
2 answers
How does Laravel Artisan created php files with properly formatted lines
This is just a general question, how does Laravel Artisan able to create proper .php file e.g. make:controller with the correct formatting and line breaks?
Is there a good PHP script which can help one develop similar php codes.
Thanks

Stanley Ngumo
- 4,089
- 8
- 44
- 64
2
votes
0 answers
Write on file in Java on a JFrame
I have to write on a file the data that I get from the fields that are already filled when a checkbox is checked.
Here is what I started write.
(please note that I was guessing with the jChackBox1.isEnabled() I'm pretty sure that is wrong)
private…

Sam
- 35
- 5
2
votes
1 answer
Finding a line in a text file and editing it
I have the following code:
String mID = jTextField1.getText();
String mType = jComboBox1.getSelectedItem().toString();
String mFName = jTextField2.getText();
String mLName = jTextField3.getText();
String mHomePhone =…

JSmithers
- 83
- 8
2
votes
1 answer
Writing arrays to a csv in columns
I have been trying to solve a basic problem (and have been Python 2.7, and have got no where. I have a csv file with column headings such as:
a,b,c
1,2,3
1,2,3
1,2,3
This is saved as test1.csv
I have managed to take each column and pass them into…

DGraham
- 705
- 2
- 10
- 23
2
votes
1 answer
Characters missing when writing in file in C
I've searched all I could and I'm actually not sure how to look for an answer as it's pretty specific.
I have a function that checks if a file exists and if it doesn't, create it and writes some parameters in it. After that another function adds…

muffinman
- 49
- 1
2
votes
1 answer
Writing to file in java using BufferedWriter
I'm trying to take some random samples from a file and do some operations and then write them to another file. But I'm having trouble writing to a file in the grepLine method which can be found below.
Inside the while loop of the grepLine function,…

Kaushik
- 553
- 3
- 11
- 27
2
votes
1 answer
File size not showing in windows explorer
I am writing lots of files using c#. File size is 1 mb and about 500 files are there in the folder.All the files are written properly with all of their contents. But some files are showing file size zero in windows explorer even though it has…

tony montana
- 105
- 1
- 13
2
votes
2 answers
how to add list of strings to a text file in ruby
I have list of strings. I am trying to append those string values to a text file.
Here is my code:
java_location = "#{second}#{first}"
The output of java_location…

suppala
- 35
- 6
2
votes
3 answers
C++ ofstream cannot write to file
Hey I am trying to write some numbers to a file, but when I open the file it is empty. Can you help me out here? Thanks.
/** main function **/
int main(){
/** variables **/
RandGen* random_generator = new RandGen;
int random_numbers;
…

user69514
- 26,935
- 59
- 154
- 188