Code covered by the BSD License  

Highlights from
str2file

4.66667

4.7 | 6 ratings Rate this file 4 Downloads (last 30 days) File Size: 1.54 KB File ID: #11668

str2file

by Wolfgang Garn

 

09 Jul 2006 (Updated 10 Jul 2006)

writes a cell array of strings into a file

| Watch this File

File Information
Description

str2file writes a cell array of strings into a file

Input:
* str ... cell array of strings, i.e. str = {'aa','bbbb','','cc'}
* file ... name of the file, i.e. file = 'test.txt'
* (optional) directory ... destination directory

Output:
* A text file.

Example
Write cell array to textfile.
+ str2file( {'aa','bbbb','','cc'}, 'test.txt' );

See also: file2str

Acknowledgements
This submission has inspired the following:
cell2file
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 (6)
15 Dec 2006 Nathan(them) Orloff

It did what I wanted it to do. It saves some time because you don't have to deal with opening and closing files, which sometimes gets hung up on my machine. It would be nice if it could handle mixed data types.

Thanks.

29 Mar 2007 Christoph Lenniger

Very good. this is the function i needed

30 Apr 2007 Jeremy Short

This will be saving me a ton of time. The script I wrote was taking at least 10 times longer.

11 May 2007 Aman Siddiqi

This works great. Thanks a lot!

17 Aug 2007 B J

If the text files you are writing using dlmwrite are too big due to unnecessary ASCII spaces, then this function will fix your problem. Good work.

31 May 2009 David Silver

Short and very useful function. Thank you!

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
writes a cell array of strings into a file Wolfgang Garn 22 Oct 2008 08:32:22

Contact us at files@mathworks.com