File Handling in C++

This tutorial will teach you how to read and write a file using C++. The information or data stored under a specific name on a storage device, is called a file. In C++, files are referred to as flow of streams (data) into and out of programs. Streams are basis data...

Reading Files

This is a small C language program that can read a text file. The program is given file name as command parameter and it reads the file line by line. The program will prints out number of characters and words in each line. The program will also prints out the number...

PHP Program to show the contents of an XML file

This is simple PHP script to show the contents of an XML file on html page. The script uses PHP XML parser to traverse through the xml file and print it’s contents. This extension requires the libxml PHP extension to be enabled.

Count the words in a file – Java

This program will read words from an input file, and count the number of occurrences of each word. The word data is written to an output file twice, once with the words in alphabetical order and once with the words ordered by number of occurrences. The input and...

The use of streams with files

The use of streams with files. This programme copy the input file to another file and also print its contents to the IO Stream. C /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made...

Reading Text Files

It contains a program that is given as command parameter the name of a text file, say, temp.dat. It will read each line of temp.dat and print out in correspondence the number of characters and words on that line. At the end it will print out the number of lines that...

Directory Structure

A small script to show all the Directories and Files in a specified Drive or Directory. It shows all the files/folders in a tree with the file size, last modified and other file attributes. It is just like the DIR/P command of the DOS. [sourcecode...

Copying One File to another in C

This is a simple C program that copies the contents of one file onto another file. It is similar to Unix’s cp  command. This C program is called with two parameters i.e. the names of two files. The contents of the file referenced in second parameter are copied onto the file which is referenced by first parameter.