All Questions

1451
votes
40answers
864416 views

Create Excel (.XLS and .XLSX) file from C#

How can I create an Excel Spreadsheet with C# without requiring Excel to be installed on the machine that's running the code?
533
votes
28answers
724445 views

How to append text to an existing file in Java

I need to append text repeatedly to an existing file in Java. How do I do that?
745
votes
22answers
1891140 views

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 data from a file. What are the possible ways and their differences?
1115
votes
27answers
1013720 views

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 on the sites I've visited. Is there a better/different way to read a file into a string in Java? ...
1008
votes
28answers
2174196 views

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?
639
votes
17answers
368533 views

Is there a way to check if a file is in use?

I'm writing a program in C# that needs to repeatedly access 1 image file. Most of the time it works, but if my computer's running fast, it will try to access the file before it's been saved back to th...
419
votes
5answers
853401 views

Read file line by line

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 in C++? I am able to get the first line, but how do I get the ...
160
votes
5answers
173884 views

getResourceAsStream() vs FileInputStream

I was trying to load a file in a webapp, and I was getting a FileNotFound exception when I used FileInputStream. However, using the same path, I was able to load the file when I did getResourceAsStrea...
618
votes
19answers
918851 views

How to read a large text file line by line using Java?

I need to read a large text file of around 5-6 GB line by line using Java. How can I do this quickly?
557
votes
23answers
928019 views

Batch file to delete files older than N days

I am looking for a way to delete all files older than 7 days in an MS-DOS batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required in...

Previous Next