Code covered by the BSD License  

Highlights from
file2str

1.0

1.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 2.13 KB File ID: #11667

file2str

by Wolfgang Garn

 

09 Jul 2006 (Updated 10 Jul 2006)

converts a text file into a cell array

| Watch this File

File Information
Description

file2str Reads a text file into a cell array of strings

Input:
* file ... name of the file, i.e. file = 'test.txt'

Output:
* str ... cell array of strings
* fullPath ... path + filename + extension
* file ... filename
* directory ... path to file

Example
Write cell array to textfile.
+ str2file( {'aa','bbbb','','cc'}, 'test.txt' );
Read the text file with
+ t = file2str( 'test.txt' )

See also: str2file

MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
11 Jul 2006 urs (us) schwarz

this copyright snippet is a simple call to TEXTREAD

s=textread(fnam,'%s',...
     'delimiter','\n',...
     'whitespace','');

us

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data import Wolfgang Garn 22 Oct 2008 08:32:22
data export Wolfgang Garn 22 Oct 2008 08:32:22
file2str Wolfgang Garn 22 Oct 2008 08:32:22
file to string cell array Wolfgang Garn 22 Oct 2008 08:32:22
read text file Wolfgang Garn 22 Oct 2008 08:32:22
text file into a c Wolfgang Garn 22 Oct 2008 08:32:22

Contact us at files@mathworks.com