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...

Show the contents of an XML in PHP

Parses an XML file and show its contents on the page. By default is assumes example.xml file in the same direcory as the script is. PHP /******************************************************* * MYCPLUS Sample Code - http://www.mycplus.com * * * * This code is made...

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...

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 into another

Similar to Unix’s cp command. This program will be called with two parameters, the names of two files. It copies the second to the first. [sourcecode language=’cpp’] /******************************************************* * MYCPLUS Sample Code...

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 - http://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...