Nate
January 20, 2023, 11:20pm
1
I’m a bit novice at this and I’m trying to get a few values out of the text parser.
I have this example where I’m getting close but I can’t make it work, and I’m not sure if this in the cleanest way?
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
(?<date>(?<=Date:\* ).+?(?=\n))|(?<duration>(?<=Duration:\* ).+?(?= s\n))|(?<CallerID>(?<=1: \").+?(?=\" <))|(?<Caller>(?<=<).+?(?=>\n2))|(?<Dialed>(?<=2: ).+?(?=\n))|(?<Confidence>(?<=Confidence:\* ).+?(?=\n))|(?<Trans>(?<=TimeDurationSpeakerPhrase\n)((.|\n)*)\n\*DISC)|
When asking your question, please include:
The steps you have taken
Relevant screenshots
Any links you have
[ Code { "and": "JSON", "in" : "code block"} ]
Exclude Personal Information.
@Nate Make it’s Text parser needs every output section to be grouped. If you don’t group it, it will not output it.
It would looke like the following (only did the first 2 parts):
(?<date>(?<=Date:\* )(.+?)(?=\n))|(?<duration>(?<=Duration:\* )(.+?)(?= s\n))
Hope this helps you out!
Let us know if you need any additional assistance!
2 Likes
Nate
January 22, 2023, 5:16pm
3
Thanks that helped!! I also needed to remove my trailing |
Another question, within this, if I want to remove “/n* s 1”, “/n* s 2” from the transcription and replace it with “Speaker1:”,“Speaker2:”, how would I go about that?
Nate
January 23, 2023, 5:45am
4
So I went to implement this but I’m having some issues
my output looks to be the same as yours but when it goes to the second node the values seemed to be null
Nate
January 24, 2023, 8:26am
5
Does it has something to do with getting the bundles into an array?
If so I’m not sure how to make that happen.
Yes @Nate , because right now you get every output into a bundle it would have “null” for something in bundle 2.
Use an array aggregator after the text parser to put everything into 1 array and use it from there.
1 Like
Nate
January 24, 2023, 3:56pm
7
@Bjorn.drivn , I tried that, but I still get them in bundles:
@Nate , no you get 1 bundle with an array which contains all items
1 Like
Nate
January 24, 2023, 4:31pm
9
@Bjorn.drivn I’m still missing something because this is what the next node looks like:
Yes, now you can use the map() and get() functions to grab your data.
2 Likes
Nate
January 30, 2023, 1:19am
14
nevermind i think i got it
1 Like
Heya @Nate awesome to hear that you found a way to achieve this
Would you mind sharing your solution with the community so that someone can potentially learn from you in the future?
Thanks a lot
Nate
January 30, 2023, 9:35pm
16
I was able to get the data out of an array like such {{get(map(20.array; “tag”); 3)}}
2 Likes