Read File Snippets


04 May, 2013   

How to read text file and print its contents to the console line by line.

The .NET Framework doesn't support automatic detection of character encoding in the default file I/O methods. This is a quick function that returns True in the specified file is Unicode.

03 October, 2013   

Basic commands for reading a text file one line at a time.

The IsFileInUse Delphi function will return true if the file is locked for exclusive access. False is returned if the file does not exist. Code "flow": Two things need to be checked here: A) Is the file a READ-ONLY file? and B) Is the file in use? The main point of the excercise is to check the files attributes for the READ-ONLY...

The IsFileInUse Delphi function will return true if the file is locked for exclusive access. False is returned if the file does not exist. Code "flow": Two things need to be checked here: A) Is the file a READ-ONLY file? and B) Is the file in use? The main point of the excercise is to check the files attributes for the READ-ONLY flag...

22 March, 2015   

Program shows copying one text file from source location to any other location (destination), plus possibility of changing its name, and also shows many language features in exception handling. This program should be run from the command prompt

This MATLAB code snippet reads in a file stored in the current directory and stores specified lines from the file in a new cell array for manipulation in MATLAB.

15 November, 2011   

Showing how to read data (an integer) from user.

Two simple functions to read an write tab seperated files (like CSV files, etc).

C++ source code for binary addition using stack in STL

04 December, 2011   

This snippet represents a simple deserializer of some basic Python types.

19 November, 2013   

C++ code example for binary addition using stack in STL

10 August, 2011   

An easy way to send an HTML email with an attachment.

18 September, 2013   

PHP example for listing directory contents

Source code - binary addition using stack in STL

20 July, 2015   

This example shows how to serialize a simple object by using the XmlSerializer.

13 April, 2011   

Reading a file to a string couldn't be easier than using the file_get_contents() function. Simple pass the name of the file (with path) and optional parameters

30 August, 2015   

Loads the contents of a dir an sorts them by the date of creation.

Java code example to list the Files or Subdirectories in a Directory

07 March, 2011   

Shows how to create a simple file download by using PHP. The content could also be dynamically generated)