LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Occasional Nugget 09/26/2022


@Ettepet wrote:

@Darren wrote:

@DerrickB wrote:

Anyone opposed to me turning a version into a VIPM package? I presume DNatt doesn't mind if I start from his, want to check with others. I would link to this forum in the package description.


Sounds great, thanks for doing this Derrick. My preference would be that you use my original VI (I did not see anybody report any bugs with the original version in this thread), and credit me as the author.


If your original post does do XML-escaping, regional-number formatting etc. you would be correct.  If it doesn't you would need to correct that.

 

I will continue to use mine, which also has some efficiency improvements and fits on my display.


As I said before, I am not a fan of your compressed coding style. There are better ways to make it fit on your display. 😁

The "efficiencies" are minor at best.

The regional-number formatting is probably important.

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 41 of 53
(1,822 Views)

Darren's does no formatting, it's up to the implementer to decide how to parse the data. That's part of it's charm.

 

And Darren knows I won't release it as-is.  Sure, there'll be a simple single VI use-case kept intact but it's definitely getting refactored into subvis to start, along with an architecture that'll let me expand capabilities going forward, and working towards other optimizations around memory allocations and repeated accesses to data.

Message 42 of 53
(1,812 Views)

 @Ettepet

I ran my minimal VIA config against your vi.

33 wires under objects?! 😱

 

Frozen_0-1674141454562.png

 

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 43 of 53
(1,811 Views)

@Frozen wrote:

@Ettepet wrote:

@Darren wrote:

@DerrickB wrote:

Anyone opposed to me turning a version into a VIPM package? I presume DNatt doesn't mind if I start from his, want to check with others. I would link to this forum in the package description.


Sounds great, thanks for doing this Derrick. My preference would be that you use my original VI (I did not see anybody report any bugs with the original version in this thread), and credit me as the author.


If your original post does do XML-escaping, regional-number formatting etc. you would be correct.  If it doesn't you would need to correct that.

 

I will continue to use mine, which also has some efficiency improvements and fits on my display.


As I said before, I am not a fan of your compressed coding style. There are better ways to make it fit on your display. 😁

The "efficiencies" are minor at best.

The regional-number formatting is probably important.


The XML-Escape codes are mandetory, so you need to make sure you do those.  The efficient code I mentioned mainly concerned that part.  If you use a sub-vi the conversion process will crawl forward for instance, if you meant that approach for fitting the display.

 

 

@Frozen wrote:

 @Ettepet

I ran my minimal VIA config against your vi.

33 wires under objects?! 😱


I coded for efficiency in speed, not looks.  Some of the code I based it on didn't even properly check on end-conditions, so that saves on wires, sure.

0 Kudos
Message 44 of 53
(1,795 Views)

I've made a few modifications to the Read XLSX File VI, and decided to publish it to github. Here's the repo:

 

https://github.com/dnattinger/read-xlsx-file

 

And if you just want the VI, you can download it directly with this link.

Message 45 of 53
(863 Views)

@Darren wrote:

I've made a few modifications to the Read XLSX File VI, and decided to publish it to github. Here's the repo:

 

https://github.com/dnattinger/read-xlsx-file

 

And if you just want the VI, you can download it directly with this link.


Good to see you added the  XML Escape codes.

 

You should also add a  decimal separator mechanism so everyone can use it, regardless of country. Excel internally uses the United States ".", so it will have to be converted for countries that use a ",".

Message 46 of 53
(774 Views)

how would you go about making this ignore images in the excel file?

0 Kudos
Message 47 of 53
(470 Views)

@dumi0501 wrote:

how would you go about making this ignore images in the excel file?


I'm assuming you ask this question because the current code doesn't properly ignore these images in excel yet.

 

In that case you would have to look into how it was encoded.  99% of what you need is already implemented, which ignores fonts etc.

 

The excel file is encoded in ".xml" files, grouped in folders, and then zipped.  Any of these zipped files not currently needed are already ignored.  Probably you would only have to add some code to ignore references to the images you mentioned, just like is being done for fonts.

 

I would unzip the ".xlsx" file, and look at these (unzipped) ".xml" text files.  It could help if you would enter a searchable term "27394338" (or whatever) in the field just before (or after) where the image is anchored on the excel sheet, and then find it in the sheet data.

 

If you are not up to that someone here can figure out how to add the needed extra filter(s).  It would help if you could attach a simple example excel file that currently causes you problems.

0 Kudos
Message 48 of 53
(456 Views)

@dumi0501 wrote:

how would you go about making this ignore images in the excel file?


This VI will return empty cells where images are, just like if you had empty cells there in the spreadsheet. 

If you want to "ignore" images, then you could add code after calling this VI to remove empty rows/cells. Just like you would if there were empty rows/cells in the original spreadsheet.

0 Kudos
Message 49 of 53
(450 Views)

i will try this out and let you know if i have any other questions.  thanks for the quick response!

0 Kudos
Message 50 of 53
(444 Views)