Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
C++ to read delimited text file

Subject: C++ to read delimited text file

From: Pinpress

Date: 18 Feb, 2011 17:00:13

Message: 1 of 2

Hi,

I know this is Matlab forum ... but I am hoping to find an easy way to read a text file, that could have delimiters like "," or ";", but could also have tab as the delimiter. For example:

1, 2, 3

Or:

1; 2; 3

Or:

1 2 3

To read into a variable is trivial in Matlab, but how can I handle this in C++? Thanks so very much!

Subject: C++ to read delimited text file

From: Steven_Lord

Date: 18 Feb, 2011 19:10:01

Message: 2 of 2



"Pinpress" <nospam__@yahoo.com> wrote in message
news:ijm8it$nfm$1@fred.mathworks.com...
> Hi,
>
> I know this is Matlab forum ... but I am hoping to find an easy way to
> read a text file, that could have delimiters like "," or ";", but could
> also have tab as the delimiter. For example:

*snip*

Since you want to know how to do this in C++ rather than MATLAB, I think
you'd have more luck finding the answer on a C++ forum or newsgroup. The
comp.lang.c++ newsgroup is available via Google Groups
(http://groups.google.com) if your news server doesn't carry it.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us