05-29-2022 09:03 AM
Hi all,
I read a excel file got data as below and some different with raw data in Excel sheet which merge data in sheet and read is blank by labview ,Do you have good way to handle this issue, thanks in advance!
05-29-2022 10:48 AM - edited 05-29-2022 12:26 PM
Starting from the top, you could just replace all empty fields with the entry from above. Here's one possibility:
(Of course if the merged cells only occur in one specific columns, further simplifications are possible)
05-29-2022 12:34 PM
@altenbach wrote:
(Of course if the merged cells only occur in one specific columns, further simplifications are possible)
Here's how that could look like:
05-29-2022 04:15 PM
What you seem to be hoping for is for LabVIEW to "become Excel" and go into an Excel WorkSheet, where Excel has allowed the User to "merge" a range of cells so that the Worksheet shows an expanded "Cell" with a single value.
What you would need to do to undo this is the following:
This requires a fair amount of expertise in VBA. In principle, you could try to do some of this using LabVIEW and low level calls to Excel VBA. It will probably, however, be faster and "guaranteed to work" to open the File in Excel, search for Merged Cells, and then manually do the steps I outlined above. When the Excel WorkSheet was originally created, someone manually replaced identical cells with a single Merged Cell. For a reasonably-sized WorkSheet, it is easy enough to find the Merges, change the Format to remove the Merge, then copy the single "merged" value into the new blank Columns and Rows.
Now your Excel Spreadsheet is in a "no Merge" format. If you want to keep it as an Excel file-type (.xls or .xlsx), I recommend using the Report Generation Toolkit. Otherwise, open the Excel file, save it in CSV format (which removes many of the more difficult Excel "features", and lets you work with the file using the "Delimited Spreadsheet" functions in LabVIEW.
Bob Schor
05-29-2022 07:31 PM
Thanks for you prompt relpy,it's very useful , occasionally real blank in excel sheet cell, how to ignore the issue, thanks!!
05-30-2022 09:56 AM
@Sam.Huang wrote:
Thanks for you prompt relpy,it's very useful , occasionally real blank in excel sheet cell, how to ignore the issue, thanks!!
Not knowing about the exact format and all possibilities, it seems that it might be sufficient to substitute the previous value of the second column ONLY if that string exists in a substring of the entry in the first column.
05-30-2022 10:34 AM
@altenbach wrote:
Not knowing about the exact format and all possibilities, it seems that it might be sufficient to substitute the previous value of the second column ONLY if that string exists in a substring of the entry in the first column.
See if this works....