problem with using waitbar while importing data

  • Permalink
  • submit to reddit
  • Email
  • Follow


hi,all
this is my first thread in this newsgroup

I am doing a gui project now for data analysis
the data is stored in '.csv' format

first I need to import the data into the gui data by a
button callback, and when this is in progress, there is a
waitbar indicating the percentage of data readed
here is my thought:
first get the total line number of the data file,
then the importing can be realized by fgetl() in a loop
and use a parameter to record the line numbers already
readed,so the percent can be calculated ,like
line_readed/line_total

and here is the problem:
since the file is pure data,there is no header or other info
about th data, how can I get the 
total line number at the first place ?

thanks for attention
0
Reply woopple (2) 10/11/2007 5:35:17 AM

See related articles to this posting


All waitbar does is to give a graphical indication of the 
progress if a task takes too long to finish. Don't use it 
unnecessarily. If you put it in a lengthy loop, the time 
it takes to update waitbar might be significant. 

If using csvread() can let you read the whole file in one 
statement, you might consider not to use waitbar at all. 
After the csvread(), you know the size of the data so you 
can put waitbar in your loop of data processing to 
indicate the progress.

"fee woo" <woopple@gmail.com> wrote in message <fekcmk$qs7
$1@fred.mathworks.com>...
> hi,all
> this is my first thread in this newsgroup
> 
> I am doing a gui project now for data analysis
> the data is stored in '.csv' format
> 
> first I need to import the data into the gui data by a
> button callback, and when this is in progress, there is a
> waitbar indicating the percentage of data readed
> here is my thought:
> first get the total line number of the data file,
> then the importing can be realized by fgetl() in a loop
> and use a parameter to record the line numbers already
> readed,so the percent can be calculated ,like
> line_readed/line_total
> 
> and here is the problem:
> since the file is pure data,there is no header or other 
info
> about th data, how can I get the 
> total line number at the first place ?
> 
> thanks for attention

0
Reply Fangjun 10/18/2007 4:29:35 PM
comp.soft-sys.matlab 203695 articles. 536 followers. Post

1 Replies
144 Views

Similar Articles

[PageSpeed] 52


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Problem of using DATA import.
I have a dataset in .txt file, this dataset is quite large, with 231,287 observations and 55 variables. the first row is the variable name. However, I met problem when I import the datafile "Question1.txt", in the log, it tells me : "Name l e n g t h is not a valid SAS name." in the same manner, it tells me all the 55 names are not valid SAS name, I do not know why this is the case, when I try to import an excel file, the variable name are same, but no such problem. After this, SAS converted all my Numeric values have been converted to character values at the places given...

Re: Problem of using DATA import.
Ann, If you provide the list with an example of what the first (or better first two) line(s) of the file look like, I'm sure that it will make it quicker for someone to help. Art ------- On Thu, 25 May 2006 15:10:00 -0700, ANNlearner <lizhe01@GMAIL.COM> wrote: >I have a dataset in .txt file, this dataset is quite large, with >231,287 observations and 55 variables. the first row is the variable >name. However, I met problem when I import the datafile >"Question1.txt", in the log, it tells me : "Name l e n g t h is not a >valid SAS name." in the ...

Re: Problem of using DATA import. #3
Ann, Using your proc import code, your file imported without any problem whatsoever. What version of SAS are you using? What is your operating system? Is there any chance that the path you've defined to locate the file isn't correct? Art -------- On Thu, 25 May 2006 18:06:53 -0700, ANNlearner <lizhe01@GMAIL.COM> wrote: >Hi, Arther: > >Thank you very much for your reply, I have sent the first two rows of >the data to you. Since I do not know how to attach files here in the >forum. > >Best Wishes, > >ANNlearner Hi, Art: You are right, I try to rea...

Re: Problem of using DATA import. #2
looks like your names have blanks in it. That is not good. Maybe you should use a data step to import it. With a macro you could get it , I think: 1. extract the names. Are there chars as delimiter? Maybe "," or ";"? Must be, because blanks are in the "name" "l e n g t h" So read the first line with data _null_; infile xxxx truncover; input a $200.; i=1; do until (dummy=" "); dummy=scan(a,i,";"); /* or whatever the delimiter is */ call symput("n"!!compress(put(i,8.)),compress(dummy)); call symput(&qu...

Problem importing Map data using Mapping toolbox
Hi, I'm trying to use the Map Viewer in the Mapping Toolbox in Matlab to view a map that's in tif format. I downloaded the data from the USGS website. But there's an error when trying to import the data from the TIFF file: ======================================================== ??? TrueColor CData contains element out of range 0.0 <= value <= 1.0. Error in ==> MapGraphics.axes.addModel>newlayer at 65 model.renderLayer(hMapViewer,layername); Warning: Error occurred while evaluating listener callback. > In MapModel.MapModel.addLayer at 20 In MapViewer.MapView.a...

Problem with importing excel file using PROC IMPORT.
Hi guys; I am using proc import to read an excel file. The excel file looks like this: It has initial few lines(redundant) describing what data is all about. then it gives the variables and again a couple of lines(redundant). then the values for those variables are displayed. The program i wrote: proc import datafile= out=; dbms=excel replace; range=; getnames=yes; run; I got var names as f1, f2... I had to label those names back. What i would like to know is there a way that the variable name will be read and data will be displayed below variable name without having to LABEL them. Than...

Import data using import wizard code generation
Hey guys, haven't used the code generation function using the import wizard before, was hoping someone could explain to me how it works. I have my file called 'World Population.csv' Using the wizard i get my data in the format i want, then check the 'code generation' box. I get a generic function generated like this: function importfile1(fileToRead1) %IMPORTFILE1(FILETOREAD1) % Imports data from the specified file % FILETOREAD1: file to read % Auto-generated by MATLAB on 24-Sep-2012 10:32:32 DELIMITER = ','; HEADERLINES = 3; % Import the file...

use this one
I have a certificate and a private key. I used keytool to create a keystore with the certificate and alias of "tomcat". keytool does not seem to provide a way to import a private key. How can you import a private key into tomcat keystore. I tried openssl using a command provided by Sudsy. openssl pkcs12 -export -in <signed_cert_filename> -inkey <private_key_filename> -name <alias> -out <keystore_filename> However, tomcat failed to negotiate ssl with the browser. I suspect there is a...

Problems in inserting data using db tools insert data.vi
Hi All, &nbsp; As a part of my application,i have to include an option to copy the records from one table to another. &nbsp; In this there are two options. &nbsp; 1)&nbsp;copy the records from one table to the another in the same database.it works and i did it using the sql&nbsp;&nbsp; query "insert into.....selecct * from..." &nbsp; 2)Copy the records from the table in the database the user selected(it can be from a database residing in pendrive also)to the table in the default path(both the tables are having the same structure).I successfully copied the ...

Import Data Problem
Everytime I try to import data or link data I get the following message Active X Component Can`t Create Object Any ideas ...

A problem about importing data
Hi,all I have several .DAT files generated by a surveying machine. I used to read these files and import data by a QBASIC Programme and save data as .SLK files. next step was Use "dlmread" to import data into matlab from SLK files. Now I wanna use matlab to read .DAt files directly, and the functins provided by MATLAB are all unable to read them.(dlmread fgetl, fgets, fread, fprintf, fscanf) I post the QBASIC Code below, It seems that the programme start to import data at a certain place, not as MATLAB reading data from top to end. DIM A(2048) AS INTEGER INPUT "FILENAME="...

Problem with data import
I have a tab delimited file with five variables. STAT-EAS454:1:2:140:785#0 81 5 57679715 37 50M HWUSI-EAS454:1:2:1351:1673#0 The first variable varies ...

import data problem
I would like to import data from a txt file load myfile.txt However within this file there are some blank spaces and I'm getting this error message: ??? Error using ==> load Number of columns on line 44 of ASCII file C:\MATLAB\myfile.txt must be the same as previous lines. Can anyone help? Thanks. On 19/12/10 8:53 PM, J G wrote: > I would like to import data from a txt file > > load myfile.txt > > However within this file there are some blank spaces and I'm getting > this error message: > > ??? Error using ==> load > Number of...

Importing data problem!!!
Hello, I have a problem about importing data. I wanna import a file of Stock data. It's have a lot of column: Date, Open, Close, Hight,... I just wanna import data with the interval specific time. Example: Data file include data from 2000 to 2010, i just wanna create a vector from 2008 to 2010. How can i do? Many thanks for your assistance Ken ...

problem with importing data
When I use import data wizard to import data(text file), the data look well in the preview. However, after the import wizard is finished, the data are actually not correctly imported. All columns except the first one become zeros and the contents in the first column are not right too. It's very weird. Does anyone know what may cause this problem? or Maybe you can suggest a good way to import data? Your help is appreciated. Ivy ...

problem in data import
Hello everyone, A new user in Matlab. Can anyone help me on how to import aASCII file in matlab which is space and tab delimited. The file ( intraday trades on greek stocks) looks like: Stock Date Time Price Volume Stock Category &#917;&#932;&#917; 04/01/2010 10293955 18.34 500 Big Cap &#917;&#932;&#917; 04/01/2010 10293955 18.34 70 Big Cap &#917;&#932;&#917; 04/01/2010 10293955 18.34 430 Big Cap ABC 04/01/2010 10293955 18.34 200 Big Cap YYY 04/01/2010 10293...

Problem with data importing
Dear Fellows i have a problem which is very interesting. i have a data like (rollno, name, course, duration and a photo of the candidate) in corel file. the problem is how to import selected data from the corel file into the MS Access. Kindly guide me how to do this. Regards ...

import data problem
Hi out there, I don't understad what happens with my data... There are 401 lines of input data). The last lines are: .... 19.7999992 -9.13599968 19.8500004 -11.6960001 19.8999996 -11.9519997 19.9500008 -12.2080002 20. -12.9759998 Importing these data in Mathematica via data = Import["00000.dat", "Table"] and everything seems to be ok. But if I try this: y = LinearModelFit[data, {x, x^2}, x] there is the error message: LinearModelFit::ivar: "{20.05} is not a valid variable" and the output is printed as: .... ...

Problem importing data
Hi all, I've a quite complicated situation in importing a data file into Matlab V.7. This is a big file with most numeric elements and some elements as "null" (text). In Windows XP and using Matlab 6.5 I'm able to import it only if I save my data file as .xls(only the format which is known as Microsoft Excel Notebook) and import it using "xlsread (file name)" command (very weird it does not work if I want to use import wizard). But I ignored it and used the command line. Now I'm trying to use a different machine which has Windows2000 and Matlab v.7. The same ...

problem while importing the data
hi i have files in notepad when i tried to load in work space i am inable to do it so i went to the current directory and opened it from there the problem is that when i open it with m-file it is good but when i give the command x= load('filename.txt') only first column is giving the original data the next columns are jus showing zeros y is it so? can anyone rectify this thx in advance lokesh hi guyz it's urgent can any one help me regarding the problem thx in advance lokesh lokesh wrote: > > > hi > > i have files in notepad > > when i tried to load ...

Data import problem
Hi there, I'm a bit of a matlab noob and I'm stuck on a data import problem. The problem is that the data logging software uses multiple delimiters (white space,/ and :). Going though it charachter by character is the only way I've found so far to load in the data but that takes all of time to do and there surely is a more efficient way of doing it. heres a sample line (it should all be on one line but the message probably wont allow that): 2/21/2005 16:00:03 62 0.00 0.37 0.00 2.50 5.07 0.00 40.00 11.00 0.00 0.00 0.00 1.00 1.00 0.29 0.29 0.01 0.00 9.56 0.00 0....

Problems importing data
Hey, I am exporting data from one database and importing into another database. I dump the data from one database like so: pg_dump dbname -R -a -f exportFile.sql I then import the data using: psql import_db -f exportFile.sql 1>>import_sql 2>>import_errorlog However, when I do the import my import_errorlog gets filled with these errors: This is the big one. It seems to happen thousands and thousands of times!! psql:exportFile.sql:196563: invalid command \N I don't know why it keeps happening! These two are similar and I think...correct me if I am wron...

I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication
I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication. &nbsp; I use LabVIEW to read the data from serial communication then, i open the example (.vi) from <a href="http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=C3279BDB00F42BEBE034080020E74861&amp;p_node=DZ52363&amp;p_source=external" target="_blank">Serial Communication - Advanced Serial Write and Read</a>&nbsp;&nbsp;from LabVIEW Example. BUT it have some error message that : Error - 1073807202 occured&nbsp; at property ...

what is the problem of using PROC IMPORT?
Dear all, the version of SAS i used is v8 and i want to import the data from the excel files. Here are the commands i used in v8 version: PROC IMPORT OUT= WORK.one DATAFILE= "C:\Documents and Settings\Desktop\Book1.xls" DBMS=EXCEL REPLACE; GETNAMES=YES; DATAROW=2; RUN; However, it was warned that the DBMS=EXCEL was in improper use. What is the problem ? Also, how can the spreadsheets within the same excel file be read into the SAS automatically? Thanks a lot!!! Regards, TM You need to be more specific in the version of DBMS...