annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

XLSX file merging columns, Help please!!

I have 2 xlsx files  with data from 2 sensors i want to create a program that can merge these 2 files in one file based on the tiem stamps.

So i want the columns of each file next to each other in a new file,

I am trying for a week but are stuck. 

 

Data 1 is from a power sensor with:

 column 1: timestamp
column2: runtime
column 3: average power
column 4: peak power

 

data 2 is from a gos sensor with: 

data gps sensor with:
column 1: timestamp
column2: latitude
column 3: longitude
column 4: altitude

 

I am also attaching the files, I hope to find some help, please

 

Tout télécharger
0 Compliments
Message 1 sur 11
4 327 Visites

I have 2 xlsx files  with data from 2 sensors i want to create a program that can merge these 2 files in one file based on the tiem stamps.

So i want the columns of each file next to each other in a new file,

I am trying for a week but are stuck. 

 

Data 1 is from a power sensor with:

 column 1: timestamp
column2: runtime
column 3: average power
column 4: peak power

 

data 2 is from a gps sensor with: 

data gps sensor with:
column 1: timestamp
column2: latitude
column 3: longitude
column 4: altitude

 

I am also attaching the files, I hope to find some help, please

 

0 Compliments
Message 2 sur 11
4 318 Visites

I have 2 xlsx files  with data from 2 sensors i want to create a program that can merge these 2 files in one file based on the tiem stamps.

So i want the columns of each file next to each other in a new file,

I am trying for a week but are stuck. 

 

Data 1 is from a power sensor with:

 column 1: timestamp
column2: runtime
column 3: average power
column 4: peak power

 

data 2 is from a gps sensor with: 

data gps sensor with:
column 1: timestamp
column2: latitude
column 3: longitude
column 4: altitude

 

I am also attaching the files, I hope to find some help, please

 

0 Compliments
Message 3 sur 11
4 335 Visites

Can you show us where exactly you are stuck (meaning: upload a VI).

 

Regards, Jens

Kudos are welcome...
0 Compliments
Message 4 sur 11
4 300 Visites

Hi shivik,

 

do as you suggested on your own in this image: read both files, sort the data by timestamp, then store the combined data in a new file.

 

Is this related to your other thread? Why not store all the data in one file just at acquisition time?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Compliments
Message 5 sur 11
4 281 Visites

Please learn how to post with attachments -- you do not need to post the same message three times, with first one set of three attachments, then two sets, then three sets.  What part of this do you not know how to do?  Where is the code (meaning a VI, not a picture) showing what you have tried?  How about showing the code that generates these two files -- maybe you would be better off writing a single file when generating the data ...

 

Are you just learning LabVIEW?  Have you spent time with the appropriate LabVIEW Tutorial material?  Do you have colleagues/teachers/co-workers with whom to discuss your project and share ideas?

 

0 Compliments
Message 6 sur 11
4 277 Visites

Hello sorry for that my internet is very slow, i will upload the vi today. Uploadig erros make hat it's being posted 2/3 times. No i have no one else to help me

0 Compliments
Message 7 sur 11
4 259 Visites

Thanks for providing some code.  I can at least give you the Bad News first ...

 

Your title mentions an Excel .xlsx file, and your earlier attachments were, indeed, Excel .xlsx files.  These are not files that can be read or written using LabVIEW's Read/Write Delimited Spreadsheet File -- those files are pure Text files, written with columns separated by a "separator character" (by default, <Tab>, but often <comma>) and rows written as lines of "delimited columns".  Note that if the delimiter is a comma, this file format can be called a "Comma-separated Values" (or .csv) file, and Excel can also open files with the .csv extension (indeed, Windows, by default, assigns an "Excel-looking" Icon to .csv files, creating confusion for LabVIEW users).

 

However, depending on the Version of LabVIEW that you have, you might have the Report Generation Toolkit, which includes routines that can Read and Write true Excel (both .xls and .xlsx) files.  So, in principle, your request can be programmed using LabVIEW.

 

Here are some things to consider:

  • Your description suggests that you want a file with one column having time, and two sets of columns containing the "other" data from the other two files.  Have you thought about how you are going to align the data if the Time entries do not match?  [I did a quick glance at your data files, and it appeared that the Time columns, in fact, did not match!].
  • I assume that the Time column is using Excel's Date/Time representation.  Unfortunately, this is slightly different from LabVIEW's TimeStamp implementation (for one thing, Time Zero differs by about 4 years; also Date/Time is expressed as Days by Excel and Seconds by LabVIEW).

There are a number of examples in the Forums and on the Web showing how to use the Report Generation Toolkit (or RGT) to read and write Excel.  If you have the Toolkit available, and can at least "have a plan" for handling the points raised above, then it should be possible to do what you describe.

 

A good place to start to learn a bit about the RGT and Excel is to search this Forum by opening the Search tool and typing the characters "Revised " (that is, Revised followed by a space).  After a second, this should pop up a number of suggestions, with the first one being Very Relevant -- I also know the author.  Study the example, see if you can adopt any of it to your question, and try your hand at writing an Excel File with LabVIEW.  If you get stuck with reading Excel, generate a new Post and we'll provide more help.

 

Bob Schor

Message 8 sur 11
4 241 Visites

Thanks for that part of help. I have now data in an lvm file. I would like to add the channel names to the columns, can you give me an idea how to do that. I have cheeked several posts but those were not useful for my case,

 

I am showing what i exactly are trying to do in the attached pictures and the way i am storing the data

Tout télécharger
0 Compliments
Message 9 sur 11
4 199 Visites

If you want to show us LabVIEW Code, attach the VI, not a picture of it.  With the VI, we can closely inspect the code, see "behind" Case structures, open up the Dreaded DAQ Assistant and check its configuration, see what version of LabVIEW you are using, test the code, "improve" the code, etc.

 

Bob Schor

0 Compliments
Message 10 sur 11
4 187 Visites