NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Active Participant
DianeS
Posts: 581

Re: How can I read in a selected portion of a large ascii file (~200Mb)?

Ah, are you quite sure?  I just created a small csv file, formatted it exactly the way you describe, and the following 1D string array came out:

 

header,header,

1,1,

2,2,

header,header,

...

etc.

 

Exactly like they're supposed to.

 

So let's back up.  Can you select a small portion of the data file you're trying to process and post it here?  You can use the attached VI to do so.

Member
doyles
Posts: 34

Re: How can I read in a selected portion of a large ascii file (~200Mb)?

Nope, not quite sure, as it turns out.  The data is there after all.  I feel about as smart as my shoe right now.  :smileyembarrassed:  I needed to extend the size of the string element in order to see the data.  I needed to extend it by more than a 1/2" for it to appear, but still.

 

When I thought about how the file read vi was working, I didn't understand why it wasn't being read in.  But I didn't think that it was actually there and I just wasn't seeing it.  (this seems to be a theme for this me at this point :smileysad:)

 

But I have it working now. :smileyhappy:  It's much faster (33s vs 59s) and the memory hit is usable.  I'm attaching the vi.  There may be a better way to convert the string array to the double array at the end.  I'd be interested in continuing to learn about that as well.  I've certainly been learning a lot on this task.

 

Thank you for the patience to walk me through.

Active Participant
DianeS
Posts: 581
0 Kudos

Re: How can I read in a selected portion of a large ascii file (~200Mb)?

Yes, that's what I suspected...that's why I made my string indicator as large as I did.  I figured that if you ran the VI, there was a better-than-even chance you'd solve your problem by yourself.  And sure enough...

 

:smileywink:

 

I have LV2010 open right now, I'll open 2011 later and look at your VI.

 

My pleasure to help, and you are much, much smarter than your shoe.  :smileyvery-happy:  It's always a pleasure to help someone who genuinely wants to learn and is willing to put in some work to do so.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page