LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Move a record up

    Employee
    Posted 02-09-2015 00:25

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: DavidHZL

    Hello,

    I have a question. Is there a way to move an record one row up? Example data:

    $GNRMC,111620.40,A,5312.67614,N,00637.28038,E,0.02 2,86.6,060215,1.2,E,D*10
    $GNGLL,5312.67614062,N,00637.28038116,E,111620.40, A,D*75
    $GPGGA,111620.6,5312.67614,N,00637.28038,E,4
    ,13,1.0,0.7,M,40.7,M,0.6,0967*79$GNVTG,310.90,T,,M ,0.03,N,0.05,K,D*2B
    $GNZDA,111620.622,06,02,2015,00,00*49
    $GNHDT,74.605,T*1B

    All these lines are from a log in a GPS module, saved as raw data. I'm able to get the data into lavastorm and give every line it's own row, but I would love some advice how to add every row that doesn't start with "$" to the previous record. What I would need in the end is that the node looks for an "$" in the raw data and starts a new row that point.

    example result:
    $GNRMC,111620.40,A,5312.67614,N,00637.28038,E,0.02 2,86.6,060215,1.2,E,D*10
    $GNGLL,5312.67614062,N,00637.28038116,E,111620.40, A,D*75
    $GPGGA,111620.6,5312.67614,N,00637.28038,E,4,13,1. 0,0.7,M,40.7,M,0.6,0967*79
    $GNVTG,310.90,T,,M,0.03,N,0.05,K,D*2B
    $GNZDA,111620.622,06,02,2015,00,00*49
    $GNHDT,74.605,T*1B

    Thanks in advance,

    David.


  • 2.  RE: Move a record up

    Employee
    Posted 02-09-2015 07:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    How much data will you be running this through? If not too much, the following is a simple way. I basically append everything together, then split by the "$" character. See attached data.

    If there's a lot of data, you may consider using the Delimited File node with "$" as the record delimiter.
    Attachments:
    splitRows.brg


  • 3.  RE: Move a record up

    Employee
    Posted 02-09-2015 09:18

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: DavidHZL

    Thanks!! That does exactly what I wanted.

    I used the Delimited File Node.


  • 4.  RE: Move a record up

    Employee
    Posted 02-09-2015 10:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: DavidHZL

    Would be great to get a bit more help.

    Next step for me is to move all records to colums. The data is a sequens of 8 types of NMEA data. I would like to move the records IN ORDER to colums.

    field 1: GNGSA | field 2: GNGSA | field 3: GNRMC | ........... | field 8: GNHDT


    Please advice.

    David.


  • 5.  RE: Move a record up

    Employee
    Posted 02-09-2015 13:39

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    The attached solution uses the first part of the string as the fields and uses the last part of the string as data.

    Let us know if you still need assistance.

    Thanks,
    Larry
    Attachments:
    splitRows.brg


  • 6.  RE: Move a record up

    Employee
    Posted 02-09-2015 14:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: DavidHZL

    Almost :-) thanks again!

    There is a slight difference, as my data has two sets of GNGSA Data, which are different. When I use the example solution I get a lot of [NULL] values .

    Data
    $GNGSA,A,3,20,9,10,6,,,,,,,,,6.5,3.4,5.5*24
    $GNGSA,A,3,85,84,69,,,,,,,,,,6.5,3.4,5.5*26
    $GNRMC,111057.40,A,5312.67829,N,00637.29680,E,0.02 6,170.5,060215,1.2,E,D*2D
    $GNGLL,5312.67828509,N,00637.29680459,E,111057.40, A,D*70
    $GPGGA,111057.6,5312.67829,N,00637.29680,E,4,09,2. 0,0.5,M,40.7,M,0.6,0967*71
    $GNVTG,315.47,T,,M,0.14,N,0.26,K,D*23
    $GNZDA,111057.624,06,02,2015,00,00*49
    $GNHDT,,*51


  • 7.  RE: Move a record up

    Employee
    Posted 02-09-2015 18:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Hmmmm, so you're saying that you'd like the two GNGSA records to show up as two separate columns? If so, we'll have to rename them. I used an Agg Ex to do so.
    Attachments:
    renameGTypes.brg


  • 8.  RE: Move a record up

    Employee
    Posted 02-10-2015 06:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: DavidHZL

    Hi Ryeh,


    This solution doesn't seem to work on multiple records. I'm unable to upload my .brg file, but if you just copy the rawdata a couple of times, you will see what the issue is.


  • 9.  RE: Move a record up

    Employee
    Posted 02-10-2015 08:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    Hi David,

    The splitRows.brg solution that I gave you yesterday assumes that there will be a single field created for each unique "GN" value. If there are 2 records for the same "GN" then it will add an additional row for that data. If there are "GN" fields that only have 1 record then in the additional rows the values will be NULL. This is the way that LAE functions, but I assume based on your response that this is not the desired output.

    I have spoken with Ryeh and we want to make sure that we can help get the exact results you need. Since neither of us a familiar with the structure of NMEA data can you please give us an example of what the exact output would look like with any additional scenarios that you think might not be evident in the input data.

    Thanks,
    Larry