Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9255993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:50:11+00:00 2026-06-18T11:50:11+00:00

I was hoping someone might be able to help me with reading in a

  • 0

I was hoping someone might be able to help me with reading in a file with textscan (or some other function in Matlab). The documentation and examples online have been no help to me and I guess I am missing something intuitive 🙁 Here is what the structure of the file I want to read in looks like:

ID,  Date of ID,    C 1-1,  C 1-2,  M R3,   M R4,   Glob ID Settings
TPOL_430_412_10X,   5/5/2011 20:23, 0,  0,  0,  0,  -1, 5.00_5.00_3_300.00_3_0.00
TPOL_430_412_10X,   5/5/2011 20:23, 0,  0,  0,  0,  -1, 5.00_5.00_3_300.00_3_0.00
TPOL_430_412_10X,   5/5/2011 20:23, 0,  0,  1,  0,  1,  5.00_5.00_3_300.00_3_0.00
TPOL_430_412_10X,   5/5/2011 20:23  0,  0,  0,  0,  -1, 5.00_5.00_3_300.00_3_0.00
TPOL_430_412_10X,   5/5/2011 20:23  0,  0,  0,  0,  -1, 5.00_5.00_3_300.00_3_0.00

Where my file is a .csv file so the delimiter is a comma. What I have been trying to no avail is the following:

fmt = [repmat('%s',1,2), repmat('%f',1,5),'%*s %[^\n]'];
fid = fopen('file.csv','rt');
data = textscan(fid, fmt, 'HeaderLines', 1);
fclose(fid);

Any suggestions greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:50:12+00:00Added an answer on June 18, 2026 at 11:50 am

    I used this

    A = textscan(fid,'%s %s %s %f %f %f %f %f %s', 'HeaderLines', 1);
    

    it should split all the parameters you want to read into a cell A with size (1,9).

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some strange drawing artefacts that I'm hoping someone might be able to
I was hoping someone might help with a function that given two parameters: @param
I have a weird problem that I'm hoping someone might be able to help
I am hoping someone might be able to help me out. I have a
I'm hoping someone might be able to help me move through an issue relating
Hoping someone might be able to assist me, or point me in the right
I am having issues writing a query and was hoping someone might be able
I am hoping that someone might be able to tell me how I could
Hoping that someone here will be able to provide some mysql advice... I am
I was hoping someone might be able to point me in the right direction

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.