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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:10:32+00:00 2026-05-16T17:10:32+00:00

My data is in following format: TABLE NUMBER 1 FILE: name_1 name_2 TIME name_3

  • 0

My data is in following format:

TABLE NUMBER 1
                                                FILE: name_1
                                                            name_2
TIME    name_3  
day name_4  
-0.01   0   
364.99  35368.4 
729.99  29307   
1094.99 27309.5 
1460.99 26058.8 
1825.99 25100.4 
2190.99 24364   
2555.99 23757.1 
2921.99 23240.8 
3286.99 22785   
3651.99 22376.8 
4016.99 22006.1 
4382.99 21664.7 
4747.99 21348.3 
5112.99 21052.5 
5477.99 20774.1 
5843.99 20509.9 
6208.99 20259.7 
6573.99 20021.3 
6938.99 19793.5 
7304.99 19576.6 
TABLE NUMBER 2
                                                FILE: name_1
                                                            name_5
TIME    name_6  
day name_7  
-0.01   0   
364.99  43110.4 
729.99  37974.1 
1094.99 36175.9 
1460.99 34957.9 
1825.99 34036.3 
2190.99 33293.3 
2555.99 32665.8 
2921.99 32118.7 
3286.99 31626.4 
3651.99 31175.1 
4016.99 30758   
4382.99 30368.5 
4747.99 30005.1 
5112.99 29663   
5477.99 29340   
5843.99 29035.2 
6208.99 28752.4 
6573.99 28489.7 
6938.99 28244.2 
7304.99 28012.9 
TABLE NUMBER 3

Till now I was splitting this data and reading the variables (time and name_i) from each file in following way:

[TIME(:,j), name_i(:,j)]=textread('filename','%f\t%f','headerlines',5);

But now I am producing the data of those files into 1 file as shown in beginning. For example I want to read and store TIME data in vectors TIME1, TIME2, TIME3, TIME4, TIME5 for name_3, name_6, _9 respectively, and similarly for others.

  • 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-05-16T17:10:33+00:00Added an answer on May 16, 2026 at 5:10 pm

    First of all, I suggest you don’t use variable names such as TIME1,TIME2 etc, since that gets messy quickly. Instead, you can e.g. use a cell array with five rows (one for each well), and one or two columns. In the sample code below, wellData{2,1} is the time for the second well, wellData{2,2} is the corresponding Oil Rate SC – Yearly.

    There might be more elegant ways to do the reading; here’s something quick:

    %# open the file
    fid = fopen('Reportq.rwo');
    
    %# read it into one big array, row by row
    fileContents = textscan(fid,'%s','Delimiter','\n');
    fileContents = fileContents{1};
    fclose(fid); %# don't forget to close the file again
    
    %# find rows containing TABLE NUMBER
    wellStarts = strmatch('TABLE NUMBER',fileContents);
    nWells = length(wellStarts);
    
    %# loop through the wells and read the numeric data
    wellData = cell(nWells,2);
    wellStarts = [wellStarts;length(fileContents)];
    
    for w = 1:nWells 
        %# read lines containing numbers
        tmp = fileContents(wellStarts(w)+5:wellStarts(w+1)-1);
        %# convert strings to numbers
        tmp = cellfun(@str2num,tmp,'uniformOutput',false);
        %# catenate array
        tmp = cat(1,tmp{:});
        %# assign output
        wellData(w,:) = mat2cell(tmp,size(tmp,1),[1,1]);
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to save a mobile number in MYSQL table with the following
I have a table which represents a line-by-line dump of the data read from
The following method of course works, but after a certain number of uploads (this
So i'm doing a wizard as such located here: how to make a wizard
I have at least 100 xml files each about 300 MB with email messages
I am a noob and am trying to get my head around TG2 and
Setup I have a VBScript for driving the stress testing of a web service.
I am currently implementing a credit card processing script, most as provided by the
I am using jqGrid 3.6.4 and a jquery 1.4.2 . in my sample i
I am trying to convert numbers in the form 123456 to 123,456 which I

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.