# Parse a TCP driver string and store the extracted values in one table row

**URL:** <https://forum.inductiveautomation.com/t/parse-a-tcp-driver-string-and-store-the-extracted-values-in-one-table-row/35585>\
**Category:** Ignition\
**Created:** [June 12, 2020, 9:46am UTC](https://forum.inductiveautomation.com/t/parse-a-tcp-driver-string-and-store-the-extracted-values-in-one-table-row/35585 "2020-06-12T09:46:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 12, 2020, 9:46am UTC](https://forum.inductiveautomation.com/t/parse-a-tcp-driver-string-and-store-the-extracted-values-in-one-table-row/35585/1 "2020-06-12T09:46:50Z")

</div>

I have several checkweighers. They each spit out weighings on UDP every few seconds and I can pick them up with the TCP driver. The string received is in the format

```auto
Date=2020-06-12,TIME=9:11:44,MachineID=Pack1, ... ,Weight=23.60,Target=23.54, etc.

```

I parse these out into memory tags _Date, Time, MachineID, Weight, Target, etc._ successfully.

What’s the best way to store these in the default database?

- I could do it with one row per weighing into a dedicated tabe but there would be a lot of  
redundant data such as the date and target weight that only change daily or with batch change.
- I could use the default historian with a deadband or log on change but I’m never confident that the table queries will match up the related data on the same row of the table.

What’s the right approach here?

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [June 12, 2020, 2:28pm UTC](https://forum.inductiveautomation.com/t/parse-a-tcp-driver-string-and-store-the-extracted-values-in-one-table-row/35585/2 "2020-06-12T14:28:39Z")

</div>

Do you have a batch ID to relate the weights to? I’d do a dedicated table with the unique information (date/time, machine ID, weight) along with a batch ID. Then you can link as many batch-related properties as you need (target, start/end times, other set points etc.) through additional tables.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 13, 2020, 12:59pm UTC](https://forum.inductiveautomation.com/t/parse-a-tcp-driver-string-and-store-the-extracted-values-in-one-table-row/35585/3 "2020-06-13T12:59:10Z")

</div>

+1 to Ben’s suggestion. On a personal level, I’d probably combine Date and Time into a single timestamp column.
