How to convert string data to cells ?

1 view (last 30 days)
azizullah khan
azizullah khan on 31 Oct 2014
Commented: Geoff Hayes on 2 Nov 2014
I have Data in string form and want to convert that data to cells:
String Data =
(114) Ins = 4
Battery Checking Plus
Account number: 23455654 a73 July 1, 2014 - July 31, 2014 a73 Page 1 of 6
Available by phone 24 hours a day, 7 days a week:
300-CALL-BAT (342-25-11)
TTY: 1-800-877-4833
En español: 1-877-337-7454
Write: Bat Fargo shop, N.A. (114)
P.O. Box 345
Portland, OR 9235-6223
Please help me in converting this data to cells with a delimiter of Tab Thanks:
Geoff Hayes
Geoff Hayes on 2 Nov 2014
The syntax in your dlmwrite statement must generate an error since there is a space between String and Data. Your code then imports the data into a local variable y which is presumably a cell array, yet in cell2csv the code references a.textdata. It isn't clear how this code would work.
If I just copy your text data into a text file (as is), I suspect that y is a 23x1 cell array. So trying to use a delimiter on each line will do nothing since there is only one column in your cell array (if more than one, then a tab would separate each column).
I think that you need to better describe your problem, and indicate how you want the output to appear. Please show how you expect the tab delimiter to be used in your above text file example.

Sign in to comment.

Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!