Hello,
I want to remove the text that starts on a new line.
Is this possible in studio X?
This is the format of the data extraction
CCO Ā· Specialisterren
Ontbrekend: Area | Moet het volgende bevatten: Area
And I only need:
CCO Ā· Specialisterren
Thank you
@Ella - Here you go⦠I have used Regex for this scenarioā¦
XAML Image
Input Txt File: new 1.txt (75 Bytes)
- Read Txt File ā Write the Output to āInputTxtā
- Write Line - Use the below code
āOutput is: " + System.Text.RegularExpressions.Regex.Match(Saved.Values(Of String)(āInputTxtā),ā^(.*)").ToString
For your Learning:
Video(One of Best)
Thank you!
Iām sorry I didnāt respond yet. Today was a busy day
I will try this first in the morning!
Does this work in In studioX?
Thanks for the documentation too
I recommend follow code.
C# code
Regex.Matches(src,@"^([^\s]+.*)",RegexOptions.Multiline) .Cast().Select(r => r.Value).ToArray();
VB Code
Regex.Matches(src,"^([^\s]+.*)",RegexOptions.Multiline).Cast(Of Match).Select(Function(r) r.Value).ToArray
Can you explain how to use this? It is my first time using Regex and I donāt get it right
These are two examples.
Automation Project Manager Ā· Dentsu Aegis Network
Je hebt deze pagina 2 keer bezocht. Laatste bezoek: 24/11/20
teamleider industrie @ VDAB | regio Antwerpen Ā· VDAB
Ontbrekend: Area | Moet het volgende bevatten: Area
The result in my excel is like this but I only need the top sentences that I have written in bold.
It did not work I think Iām doing something wrong
I never used regex so it is a bit difficult to understand
@Ella - these texts are totally different from what you have provided before. Please let me know from the above texts what you want to extract?
For Regex ā¦please spend 30 mins and go through the entire video. That will definitely help in boost your understanding.
I spoke too soonā¦My Regex is still workingā¦please see the below screenshotā¦
Here is the xaml ā¦StudioX_StringManipulation.zip (101.5 KB)
Output
Thank you so much!!
Ella, I misunderstood.
I thought that you need all lines without space line in Multi line sentence.
If you want to need just only top line, just use split method.
src.Split(vbNewLine)(0) ā split sentence into string array by line and return first line string
This is indeed what I need, can you tell me how I best apply this in studio X I have tried but I am not sure how, I get exclamation mark
Sorry Ella!
I have not used studio X yet.
Just think about using studio.
Studio X has many limitation.
I recommend studio.
Good luck!
@park363 - Thats what I was wondering⦠all your solutions here are good for Studio but not for Studioxā¦Studiox can still accept some but since its mainly used for citizen developers (less code/no code), thatās why I was providing all easy/med solutions for @Ella query.
You can check hereā¦underneath the Topicā¦
I did manage to use the regex you shared with me. but I wonder if there is regex that only keeps the first line (any format) and after the end of the first line cuts off the rest (second line and so on) I see \s but I still find it difficult to understand it all. Iāll share a screenshot tomorrow. because now after that āwrite line, outputā I have a āwrite fileā āread fileā and tried to write the output of the regex to my excel. I think Iām making this too difficult for myself. I usually make the mistake of making it more complicated than necessary.
Thank you very much for helping me
@Ella - If you could give me a clear requirement on your Input , Output and Where you want to finally write the output, that would make everyone life easier instead of lot of back and forthā¦
I donāt find Regex harderā¦then here is another solution as suggested by Parkā¦
write Line:
"Output is: " + Split(Saved.Values(Of String)(āInputTxtā), vbNewLine)(0)ā¦
You can easily write this in an excel file in 3 different rowsā¦if thatās what you wantā¦
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.