Dear all,
I have the data as shown in Text column which contains the text with multilines.
I would like to set the formula for obtainind the result as shown in Target column by removing the line for the line starting with the text a-z and remaining the line for the line starting with the number 0-9.
However, the expression: REGEX_Replace([_CurrentField_], '\n', ' ') will remove all lines within the cell.
Please kindly suggest me about the expression to remove the line within the cell with condition (remaining the line for the line starting with number).
Thank you so much in advance.
Best regards,
Solved! Go to Solution.
Hi @Boontida
I'm pretty sure regex doesn't support using \n. Try this:
Replace([_CurrentField_], '
','')
Dear @Luke_C
Thank you so much for you help.
I try by using your expression and I have still found that all lines in the cell will be removed.
I would like to maintain some lines within the cell (the line starting with number 0-9 is still the new line) and remove only the line starting with the text a-z.
For example,
Good morning How are you
I'm fine thank
you
1 aa bb cc
aaaaa
2 bbbccc
To
Good morning How are you I'm fine thank you
1 aa bb cc aaaaa
2 bbbccc
Kindly suggest please.
@Boontida , Please try using the attached workflow and let me know if it helped
Hi, @Boontida
If only flow your example data, you can use the formula:
---> Please pay attention to copy the formula directly for use, do not edit it into one line.
Replace(REGEX_Replace(Replace([Text], "
", "|"), "\|[a-zA-Z][^0-9]+(?=\||$)", ""),"|","
")
********
If it can help you , please mark it with a solution to share more.
Dear @grazitti_sapna
Thank you very much for your help.
However, I've still found some output data which removes all new line (as shown in record 1 of the picture below).
Kindly suggest please if you have any solution.
Thank you in advance
Dear @flying008
Thank you very much for your help.
However, some text in the output cell is deleted (as shown in record 1 of the picture below).
For example, my input contain the data as shown below
Input
Good morning How are you
I'm fine thank
you
1 aabbcc
aaaaa
2 bbbccc
And the reult is found to be as follows.
Output
Good morning How are you
1 aabbcc
2 bbbccc
From the example, the text "I'm fine thank you" which should be shown in the same line of "Good morning How are you" is deleted.
Kindly suggest please if you have any solution to fix this problem.
Thank you in advance
How about this one:
REGEX_Replace([Text], '\n([[:alpha:]])', ' $1')
Hi, @Boontida
1- Jesus! maybe now I finally get the result you want!
2- Please modify the formula to :
REGEX_Replace([Text], "\n(?=[a-zA-Z])", " ")
************
Please mark this as the solution if it answers your question, it will help others to find solutions quicker.
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |