problem with using waitbar while importing data

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
woopple (2)
10/11/2007 5:35:17 AM
comp.soft-sys.matlab 206931 articles. 560 followers. lunamoonmoon (258) is leader. Post Follow

1 Replies
235 Views

Similar Articles

[PageSpeed] 59
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
Fangjun
10/18/2007 4:29:35 PM
Reply:
Similar Artilces:

Small programs demonstrating the possible use of neural networks
Could you please tell me, where I can find such programs (like in the topic. Now I have only program which recognizes letters. Thank you in advance! Sorry for my poor English... -- *Remove NOSPAM from my email* "I have great faith in fools, my friends call it self-confidence" (Edgar Allan Poe) Ishar wrote: > > Could you please tell me, where I can find such programs (like in the > topic. Now I have only program which recognizes letters. At the URL below, of course! None of the six programs there recognize letters. Mitchell Timin -- "Many are stubborn in p...

ORA-00997 8i trigger long raw problem
Hi, Have a table that i need to populate with 1 record of an identical type from another table in an after insert using a trigger. Usually no problem at all except am forced into using and keeping a field which is a LONG RAW type that now generates an ORA-00997 error. It is all text stored in a LONG RAW format. The table the record needs to be inserted INTO looks like ... RFQ_ID VARCHAR2 15 RFQ_LINE NUMBER 0 TYPE CHAR 1 BITS LONG RAW BITS_LENGTH NUMBER 0 The data the table comes FROM looks like this. PART VARCHAR2 30 PART_LINE NUMBER 0 TYPE CHAR 1 BITS LONG RAW BITS_LENG...

HLA asm problem?
When compiling my HLA code I get (100s of these): .... dted3.asm:182: Error: suffix or operands invalid for `push' dted3.asm:199: Error: suffix or operands invalid for `push' dted3.asm:201: Error: suffix or operands invalid for `push' dted3.asm:221: Error: suffix or operands invalid for `pop' .... When I try it on another Linux box it compiles no problem. Problem box: SuSE 10.0 (kernel 2.6.13-15.8), HLA 1.86, GNU assembler 2.16.91.0.2 20050720 (SuSE Linux) No problem box: SuSE 9.2 (kernel 2.6.8-24), HLA 1.86, GNU assembler 2.15.91.0.2 20040727 (SuSE Linux) ---John jchludz...

a problem
hi, any one of the group ,please solve my problem "is there is any method to find given number is even or odd without using if ,else ,for,while,switch,conditional operators,if else ladders...." On 10 Feb 2007 06:15:46 -0800, bharath539@gmail.com wrote: > any one of the group ,please solve my problem > "is there is any method to find given number is even > or odd without using if ,else ,for,while,switch,conditional > operators,if else ladders...." Yes, there is. Problem solved! /gordon -- [ don't email me supp...

Registry Problem in Vista
Since I got Vista, Eudora has been unable to register itself in the registry. Every time I start Eudora, I get a pop up that claims Eudora could not register itself and I have to dismiss the pop up before Eudora will process the mail. This also prevents Eudora from being registered as the default mail client. Has anyone solved that annoyance? (This may be a non-issue for me, since I am considering wiping this notebook, and installing XP. The answer may help me make up my mind.) Rick Rick wrote: > Since I got Vista, Eudora has been unable to register itself in the >...

123 VER9 DATE PROBLEM
I am attempting to assign a script to a button that will, when first placed in the proper cell. Enter @now- then do a range value- then place in edit mode- then move the cursor to the start and erase the 2 characters that are the day and await the input of the day I want to use- then it closes with the enter button. I have figured all this out except that the {EDIT} command when used returns the date number. I have found that it does not represent the F2 keystroke. What am I missing here. The cell is formatted date-13-Dec-2006. Thanks Dave David Cartier wrote... >I am at...

When using select call on many sockets, how to check if one of them is closed
I am using the select call to read from many sockets. I don't want to call read on every socket to check if it is closed, as it defeats the purpose of using the select call. Is there any way to know whether one of the sockets have been closed, without actually testing each socket. prashantkumar1982@gmail.com wrote: > I am using the select call to read from many sockets. I don't want to > call read on every socket to check if it is closed, as it defeats the > purpose of using the select call. > Is there any way to know whether one of the sockets have been closed, > with...

Menu Problems
figure string = {'Item 1','Item 2','Item 3'}; %Menu menu_hdl = uimenu('Label','Options'); for i = 1:3 uimenu(menu_hdl,'Label',char(string(i)),'Callback','disp(char(string(i )))'); end problem- when uimenu is executed in the for loop variable i is assigned as intended to the label in the menu but when the Callback is executed from the menu it grabs the latest value of i and not the one that should have been assigned when the menu was created. Is there any way to get the desired value of i passed to disp(char(stri...

-1 / +1 problem..
Hello all, I am sorry to ask you again for another problem, as I am a new MATLab user. I have a matrix, rAlphaSet with combinations of +1 and -1. I want to make 2 Matrices rAlpha1 and rAlpha2. I took 2 random numbers r1 and r2. Then I wanted to copy the r1th and r2th column of rAlphaSet to rAplha1 and rAlpha2. But the problem is, when I was running the code, rAlpha1 and rAlpha2 were not having the columns from rAlphaSet. Here is the code: rAlphaSet = (npermutek([-1 1], 2^m))'; rAlpha1 = zeros(2^m,N); rAlpha2 = zeros(2^m,N); for i = 1:N r = randi(256,1); rAlpha1(:,i) = rAlphaSet...

Using dgesdd from matlab
We are looking at using dgesdd() , in place of dgesvd() (svd()) to see if things speed up. The matlab manual stills says that svd() uses dgesvd() from lapack, what is the simplest way to use the speed benefit suggested by dgesdd() in the lapack manual. This is on linux, and we have both MKL, ACML and NAG available. I assume we could write a mex wrapper around the call, or can we load the .so file directly into matlab? Similar to and dlopen() ? Brock "Brock " <brockp@umich.edu> wrote in message news:gtafa5$56c$1@fred.mathworks.com... > We are looking at using dgesdd()...

Problem with PID.vi
I'm using LABVIEW 4.1 with PID Toolkit I use PID VI. I try to use it in an furnace control but doesn't work. For example, with a set point of 50% output stay still to a level of 25% with the PV following this value. What could be the origin of this problem? Does anyone succeed in working perfectly with PID VI from NI? Advices are welcome Hello hora, My first bit of advice would be to see if you have tuned your PID correctly. It would seem to me that you have proportional gain (K) but no integral (I) to eliminate your SP-PV error. Also watch the "reinitial (F)" input. ...

I also need help with Duplex on my IP4000 (Different Problem)
It seems that if I print the same document with exact same settings the print quality of black is paler when using Duplex. It seems that it is not using the same black ink as the Non Duplex printing. Anyone know if this is the case, or should I try a reinstall of the software? Thanks Mike FIRST YOU SHOULD USE ONLY CANON OEM PIGMENTED INK AND SELECT PLAIN PAPER. THEN YOU SHOULD USE A HIGH QUALITY PAPER LIKE HAMMERMILL PREMIUM INKJET PAPER THAT YOU CAN GET AT STAPLES OR OFFICE DEPOT. YOU SHOULD NOT EXPERIENCE THAT. BUT IF YOU DO NOT USE CANON OEM INK THEN YOU ...

Problem with comma delimted file
My access table when exported to a comma delimited field gets all messed up because some of the fields have the double quote character - ". Used for measurements and other things. I guess I will have to strip them out. How can I replace the " for a blank space? I am having trouble doing it with the replace command in a sql statement. sqlstatement = "update table set table.[item] = replace(table.[item]," & """""""" & "," + """""" + ")" this gives an error. what to do? On...

Problems with wxProcess::OnTerminate()
I'm having problems with the following code. The program (sleep.exe) is executed as expected, but Process::OnTerminate() is never called. (The text "Terminated" is not printed and it never breaks on the function in the debugger). I'm using Visual C++ 7.1 and the program is linked to wxBase with wxUSE_GUI set to 0. All help is apreciated. Here's the code: ------------------------------------ main.cpp --------------------------- #include <wx/process.h> #include <wx/app.h> /********************************************************************...

Problems with compilation for Windows
Trying to prepare FreeWrap for Windows, I've got a problems while compiling Tk 8.5.1 (using free "Express" release of Visual C++, taken from MS-site). The compilation has been interrupted with errors: ============================================================================= link -nologo -machine:IX86 -ltcg -release -opt:ref -opt:icf,3 -subsystem :windows -stack:2300000 -out:".\Release_VC9\wish85s.exe" kernel32.lib user32.lib gdi32.lib "c:\freewrap\tcl8.5.1\win\Release_VC9\tcl85s.lib" .\Release_VC9\tk_St atic\winMain.obj .\Release_VC9\tk_Static\wi...

Displaying Multidimensal Data
I've got a situation where I need to display a multidimensional array in a widget_text. The only way I can figure out how to do it is to create a complex structure of nested for loops for each dimension. Something similar to how print displays the data would work (as long as I could add an index before), but I can't get that output into a variable. Does anyone know of an elegant method for displaying multidimensional data in IDL? Thanks for any help. hocmin, <hocmin@gmail.com> wrote in message news:1128351838.383585.129360@g14g2000cwa.googlegroups.com... > I've got...

Monitor problem
Hi, This shows how long it's been since I've had to do this... I've had to get some material off the RiscStation in front of me at work. It's connected to an IIyama VisionMaster 1451 (nice big monitor), but I'm not getting any display. I've tried pressing 0 on boot (as well as 1 - 4) and T (and R - can't remember what the reset is), but nothing seems to happen. Is there any way I can get a machine to boot so it thinks the monitor is an AKF51 (or whatever the "default" was)? TTFN Paul -- "Logic, my dear Zoe, is merely the ability to be wrong wi...

UDB 7.2, LDAP and ODBC Data Sources on Client
Hi everybody, we are using DB2 UDB 7.2 FP 11 on WinNT 4.0 (SP5) machines, LDAP works quite fine. As I already googled, there is however the question on how to apply e.g. "db2 catalog system odbc data source <name>" on the client-machines. One can roll out an initial config, no problem. But how do you guys out there manage deleted or new databases on your clients? I read one post about "self-repairing MSI packages" but unfortunately, the author did not elaborate further. Would I have to use e.g. a WSH-script (check if all DBs in LDAP are catalogued as OD...

problem with auctex
All, I just installed auctex in Windows. And because I uses a portable MikTex (installed in a USB disk), the PATH doesn't include the directory that contains the LaTeX executable commands. Is there a way in Emacs or auctex that can tell auctex where to find the latex commands? For example, can I setup the PATH variables directly in Emacs? Thanks you! caixj "halo" <xuejun.cai@gmail.com> wrote in message news:1160815903.006626.26780@m7g2000cwm.googlegroups.com... > All, > > I just installed auctex in Windows. And because I uses a portable > MikTex (installed...

installation problem uconv-0.4.12. plz help
Hi guys, I need to install Unicode Conversion Module for Ruby version 0.4.12 by Yoshida Masato.I have followed the commands of the link inmy windows system http://www.yoshidam.net/uconv_en.txt but when I use the command "ruby extconf.rb" it create "MakeFile" but when I use "make" command it fails...'make' is not recognized as a command so I can not install Uconv. I use ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] How can i solve the problem? Any other way to convert Unicode string to Japanese string. -- Posted via http://www.ruby-forum.com...

Word won't hold ODBC data source #2
Everyone, I posted the message below back in February and didn't get any information. I also wasn't able to find any documentation in MS Help, web site, or other groups. I'm posting now with results of my research in case anyone else might need this information. I consulted with my MIS colleague, and he said it would be ok to have each merge file pull the whole database when the criteria screen is opened. His reasoning was that it doesn't take as long as copying or moving a large file, which people often do without causing network problems. We also found it doesn't ac...

love problem solution baba ji +917891655189 mumbai #2
love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +917891655189love problem solution baba ji +9178916551...

problems installing...
Cheers all, i realize 6.3 is old, but its the disks we have here. My problem is this. Im trying to install this on old sun O2 machines that already have an existing irix install on them. I basically want to whipe the system clean and start fresh. So i boot up, hit esc, install system software, blablabla select cd rom, reboots, boots up IRIX release 6.3 ..... Current system date is.... Mounting file systems: /dev/dsk/dks0d1s0: Invalid agrument Unable to mount partition: /dev/dskdks0d1s0 on /root. This is your system disk: without it we have nothing on which to install so...

ASA to IOS VPN problem
This is a multi-part message in MIME format. --------------080700010601090400070905 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi all, I am facing a problem trying to establish a tunnel with one of our supplier. Their side is terminated on a IOS router currently unknown type and version (should be 12.2 - 12.4), my side is an ASA 7.2(2), configurations are attached (at least the snippet of the IOS config I was able to get). Apparently Phase 1 completes correctly but P2 fails with "Received non-routine Notify message: No proposal cho...

x-> 0 limit problem in MATLAB?
Hi, I recently tried to evaluate the function: f=(x.*exp(x)-exp(x)+1)./x.^2 for values very close to zero. Typically, whenever the argument is zero, I replace it with eps to avoid the singularity in the denominator. It can be shown that the limit of f for x->0 is 0.5. Indeed, for small values of x, f correctly approaches 0.5. E.g: x=1e-6;f=(x.*exp(x)-exp(x)+1)./x.^2 f = 0.5000 However, something strange happens when I make x even smaller: x=1e-7;f=(x.*exp(x)-exp(x)+1)./x.^2 f = 0.5107 And ultimately: x=eps;f=(x.*exp(x)-exp(x)+1)./x.^2 f = ...