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 8417905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:10:14+00:00 2026-06-10T02:10:14+00:00

I have a large text file as below imported in MATLAB : Run Lat

  • 0

I have a large text file as below imported in MATLAB:

Run Lat Long Time
1 32 32 34
1 23 22 21
2 23 12 11
2 11 11 11
2 33 11 12

up to 10 runs etc.

So I’m trying to break up each section in the file: section 1, section 2, etc and write it to 10 different text files. File 1 will have data from Run 1. File 2 will have data from Run 2.

  • 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-10T02:10:16+00:00Added an answer on June 10, 2026 at 2:10 am

    What you’re looking for is Matlab’s textread function. I’ll give you the pieces you need and frame out the logic, but you’ll need to connect the pieces yourself 🙂

    Your read would look something like this

    [head1, head2, head3, head4] = textread(file_name,'%s %s %s %s',1);
    [run, lat, long, time] = textread(file_name,'%u %u %u %u');
    

    and your write method would use a loop to iterate over the values in

    unique(run)

    creating a file with

    fout = fopen([base_file_name_out num2str(run_number)]);

    and writing to it the values contained in

    lat_this_run=Lat(run==run_number);

    using the method

    fprintf(fout,'%u %u %u\n', lat_this_run, long_this_run, time_this_run)

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

Sidebar

Related Questions

I have a large text file that has the following headings that I'm trying
I have a large text file. I am trying to find all the phrases
I have a large text file that contains multiple columns of data. I'm trying
I have a large text file I am reading from and I need to
I have a large text file in the format of. english word: spanish equivalent
I have a a large text file (over 70mb) and need to count the
I have to remove quotes from a relatively large text file. I have looked
Okay, basically, I have a large list of phone numbers in a text file
I have a large text file I need to sort in Java. The format
I have a large text file that has a lot of special characters in

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.