Reading and Writing Files



This chapter presents and describes the main functions and procedures for reading and writing files. First, in Sect. 5.1, the most commonly used and basic file formats are presented along with specific functions for handling them. These include the MATLAB® proprietary binary MAT-file format, as well as more conventional formatted and unformatted text files which are commonly referred to as plain text files. Then, in Sect. 5.2, functions for reading and writing some other commonly used file formats such as CSV, Row-Column-Value, XLS and XML are presented and described. Finally, in Sect. 5.3, some useful tools for working with datasets and document collections are presented.


File Format Text File Regular Expression Sparse Matrix Quotation Mark 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. (2011) C++: reference: C library: cstdio (stdio.h): fprintf. Accessed 20 Oct 2011
  2. Joachims T (2008) SVM-light: support vector machine. Cornell University. Accessed 12 Feb 2011
  3. Korpela J (2009) A tutorial on character code issues. In IT and communication. jkorpela/chars.html. Accessed 20 Oct 2011
  4. Shafranovich Y (2005) Common format and MIME type for comma-separated-values (CSV) files. The internet society. Accessed 20 Oct 2011
  5. The MathWorks (2011) MATLAB file I/O guide. Accessed 20 Oct 2011
  6. Wächter A (2010) Triplet format for sparse matrices. In introduction to IPOPT. Accessed 20 Oct 2011
  7. W3C (2008) W3C recommendation on extensible markup language (XML) 1.0, 5th edn. Accessed 11 Jan 2011

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.Barcelona

Personalised recommendations