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:
Importing Multiple .txt files from directory and selecting data

Subject: Importing Multiple .txt files from directory and selecting data

From: Chris

Date: 17 Jul, 2013 17:48:09

Message: 1 of 2

I am having trouble importing multiple text files from a directory and selecting the appropriate data from them. The .txt file is semicolon delimited and has column headers. I would like MatLab to read each of these files in order, import the rows and columns I need. Also, I would like to know how to have the program read x values from the first file and then y values from all files and organize those into a single element.

Thank you

Subject: Importing Multiple .txt files from directory and selecting data

From: dpb

Date: 17 Jul, 2013 18:15:57

Message: 2 of 2

On 7/17/2013 12:48 PM, Chris wrote:
> I am having trouble importing multiple text files from a directory and
> selecting the appropriate data from them. The .txt file is semicolon
> delimited and has column headers. I would like MatLab to read each of
> these files in order, import the rows and columns I need. Also, I would
> like to know how to have the program read x values from the first file
> and then y values from all files and organize those into a single element.

<http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F>

Particularly the second option is pertinent...there's also other
examples in the documentation under the section on importing data.

doc textscan % for reading

--

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