Hi Makers,
This is a follow-up to this thread: Split text in single line into multiple parts
I receive text content from a mailhook → Split it into different lines → Use the data in certain lines to process the scenario further.
After implementing some excellent and detailed solutions presented by samliew, I was able to fix my issue of Splitting a line of text content into separate parts using RegEx. However, I encountered issues after running the scenario for the past week.
While I was certain that splitting the lines would ensure that certain content would ALWAYS be in certain rows of the array, I was proven wrong.
Are you very certain that the text you want to split will always be in the array index 4 and 5?
this is the concern user @samliew raised from the get-go which did prove to be valid.
There are few instances where text being entered by users overruns the line limit for the line split and its placed into the next line. And that messes up the whole flow.
Here are input & output logs of a Set Variable module that’s splitting text received from mailhook by newline in a failing case:
input-module-failing-case.txt (1.7 KB)
output-module-failing-case.txt (1.6 KB)
first-text-content Array
1 Pure Chat
2 [https://app.purechat.com/content/images/logos/purechat-teal-small.png]
3 https://app.purechat.com Missed Chat
4 Your Name: Tester Date: 1/7/2024 Your Email: Tester1@yahoo.co.in Your
5 Number: 1234567890 Your Requirement: Extra detailed requirement mentioned
6 comes here Website:
7 https://www.domain.com/page-post-name/
8 [https://www.domain.com/page-post-name/]
9 Source: https://www.google.com/ [https://www.google.com/] Operator: - Tags: -
10 Tester 17:11
11 joined the chat
12 Tester 17:11
13 Extra detailed requirement mentioned comes here
14 This chat was closed because the visitor left the page or lost internet
15 connectivity.
16 Thanks for using Pure Chat!
17 Details:
18 Date: 1/7/2024
19 Operator: No operator
20 Website: https://www.domain.com/page-post-name/
21 Source: https://www.google.com/
22 IP Address: 192.168.1.1
23 Rating: No Rating
24 Feedback:
25 Your Number: 1234567890
26 Your Requirement: Extra detailed requirement mentioned comes here
27 Your Email: Tester1@yahoo.co.in
28 Tags:
29 [1/7/2024 - 17:11] Tester joined the chat
30 [1/7/2024 - 17:11] Tester said:
31 Extra detailed requirement mentioned comes here
For comparison, Here are the input and output modules from the previous case we first looked at in the linked thread above and found the original solution for:
line_split_module_input.txt (1.4 KB)
line_split_module_output.txt (1.3 KB)
Sometimes the Your Requirement text is long and overruns into the next line and that’s causing the scenario to not run as expected.
Theory: If I can remove all the lines in the array from 1 to 17 and then work with the content after line 17 in any instance, that would solve the issue probably.
Any advice on how I can tackle this?