Top "File-io" questions

File I/O is input/output that involves the file system.

How do I create a file and write to it in Java?

What's the simplest way to create and write to a (text) file in Java?

java file-io
How do I tell if a regular file does not exist in Bash?

I've used the following script to see if a file exists: #!/bin/bash FILE=$1 if [ -f $FILE ]; then echo "File $…

bash file-io scripting
Reading a plain text file in Java

It seems there are different ways to read and write data of files in Java. I want to read ASCII …

java file-io ascii
Correct way to write line to file?

I'm used to doing print >>f, "hi there" However, it seems that print >> is getting deprecated. …

python file-io
Find all files in a directory with extension .txt in Python

How can I find all the files in a directory having the extension .txt in python?

python file-io
Writing a list to a file with Python

Is this the cleanest way to write a list to a file, since writelines() doesn't insert newline characters? file.writelines(["%…

python file list file-io newline
Read file line by line using ifstream in C++

The contents of file.txt are: 5 3 6 4 7 1 10 5 11 6 12 3 12 4 Where 5 3 is a coordinate pair. How do I process this data line by line …

c++ file-io ofstream
How do I create a Java string from the contents of a file?

I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least …

java string file file-io io
Print string to text file

I'm using Python to open a text document: text_file = open("Output.txt", "w") text_file.write("Purchase Amount: " 'TotalAmount') …

python string text file-io