DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

left justify data

I have some data on the speed of tides. It is presently organised into 12 channels; time, the height of the tide and 10 speed channels. Each speed channel is at a certain height above the sea bed. I need to change the speed data so that the channels are relative to the surface of the sea rather than the sea bed. That means I need to compare the channel heading (which is height above sea level) with the height of the tide in order to know which new channel to put each speed reading in to.

I can do this in Excel but the excel files are too large for my computer so I'd like to do it in DIAdem. In Excel the data appears to be right justified before and left justified after the operation. In Excel I use the Macro:

 
Dim i As Integer
Dim j As Integer
Dim k As Integer

For j = 8 To 9142

k = 17

For i = 6 To 15

If Cells(7, i) < Cells(j, 4) Then
k = k + 1
Cells(j, k).Value = Cells(j, i).Value
End If

Next i
Next j
End Sub

 

How can I left justify data in DIAdem please?

0 Kudos
Message 1 of 7
(4,967 Views)

Hi RogerC,

 

I'm afraid I'm struggling to reconcile your statement of need with the code you provided.  It sounds like you need to subtract the water height for each of your tide speed channels from the global surface height value in order to convert them to depth values relative to the water surface.  Yet your code has no subtraction operator in it.  Furthermore, I have no idea how "left-justification" or "right-justification" of the cell texts has any bearing on any of this.  You must mean something more substantive than the display of the values, yet I can't guess what it is.

 

Would you be able to post your data file so that I can see the data you're talking about?

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 7
(4,940 Views)

Hi Brad,

 

Sorry, that was a confusingly worded question. I've attached the Excel file with the macro which should make it clear what I'm trying to do.

 

thanks,

Roger

0 Kudos
Message 3 of 7
(4,883 Views)

What I need to do is to re organise my speed values. They are currently organised by height wheras they need to be organised by depth.

 

Thanks

0 Kudos
Message 4 of 7
(4,846 Views)
Do you think this will be possible please? When we bought DIAdem we were told this was the type of thing that it could do.
0 Kudos
Message 5 of 7
(4,779 Views)
I should add that I can't do this using Excel since the files are too large.
0 Kudos
Message 6 of 7
(4,778 Views)

Hi RogerC,

 

Yes, we can do this in DIAdem.  It would help to have the full file.  You say that it doesn't all fit in Excel-- I assume that's because there are too many rows in your ASCII data file to import into Excel.  Could you please send over the full ASCII data file?  You may need to post it at ftp.ni.com/incoming using WINDOWS Explorer.  Then please let me know what the posted file name is.  It may be easier to continue via email (brad.turpin@ni.com).

 

I can follow the logic of the Excel macro, but I don't see the method you used to transform the height column headings into the depth column headings.  How do you start with SensorHeight=6.79, TideHeight=7, and FrameHeight=0.59 and arrive at 0.5 for the corresponding depth under the water surface?

 

Brd Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 7 of 7
(4,764 Views)