# Re-format string to single lines

**URL:** <https://forum.inductiveautomation.com/t/re-format-string-to-single-lines/91113>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 30, 2024, 3:36am UTC](https://forum.inductiveautomation.com/t/re-format-string-to-single-lines/91113 "2024-05-30T03:36:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [May 30, 2024, 3:36am UTC](https://forum.inductiveautomation.com/t/re-format-string-to-single-lines/91113/1 "2024-05-30T03:36:01Z")

</div>

I have string stored in a database. It is the output log of IBM CPLEX  
When I retrieve it into Ignition, it is a single (long) line of text of type :class com.inductiveautomation.ignition.gateway.datasource.BasicStreamingDataset  
The string has many line separators \n  
How do I reformat this to display in a text component that looks like:

! --------------------------------------------------- CP Optimizer 22.1.1.0 --  
! Minimization problem - 12 variables, 27 constraints  
! TimeLimit = 1  
! LogVerbosity = Terse  
! Initial process time : 0.01s (0.01s extraction + 0.00s propagation)  
! . Log search space : 16.8 (before), 16.8 (after)  
! . Memory usage : 441.6 kB (before), 441.6 kB (after)  
! Using parallel search with 8 workers.  
! ----------------------------------------------------------------------------  
! Best Branches Non-fixed W Branch decision  
0 12 -

- New bound is 34920

- 

```
    45320 15 0.12s 1 (gap is 22.95%)
    45320 2024 7 1 F -

```

- New bound is 40120 (gap is 11.47%)  
45320 2024 7 1 -
- New bound is 41799.95 (gap is 7.77%)  
! Using failure-directed search.  
45320 2031 7 1 F 2399 \>= startOf(O\_103#0#P2#O\_1  
03#12000.0)
- New bound is 45316 (gap is 0.01%)  
! ----------------------------------------------------------------------------  
! Search completed, 1 solution found.  
! Best objective : 45320 (optimal - effective tol. is 4)  
! Best bound : 45316  
! ----------------------------------------------------------------------------  
! Number of branches : 19044  
! Number of fails : 11218  
! Total memory usage : 4.5 MB (4.5 MB CP Optimizer + 0.0 MB Concert)  
! Time spent in solve : 0.12s (0.12s engine + 0.01s extraction)  
! Search speed (br. / s) : 170035.7  
! ----------------------------------------------------------------------------

Thank you  
'

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [May 30, 2024, 5:03am UTC](https://forum.inductiveautomation.com/t/re-format-string-to-single-lines/91113/2 "2024-05-30T05:03:40Z")

</div>

sorry  
all sorted now

---

<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:** [May 30, 2024, 7:43am UTC](https://forum.inductiveautomation.com/t/re-format-string-to-single-lines/91113/3 "2024-05-30T07:43:15Z")

</div>

Please either share the solution or delete the thread. As it stands the thread is useless for anyone else. Thanks!

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [June 21, 2024, 6:04am UTC](https://forum.inductiveautomation.com/t/re-format-string-to-single-lines/91113/4 "2024-06-21T06:04:05Z")

</div>

Returned the query as JSON format, selected data[0] and returned it to textArea.  
This component did the rest
