Skip to content
Advertisement

How to append several phrases of a string to different lists in a loop

it is actually really difficult to write a suitable title for this question, so please correct if you find something more percise.

My problem is basically, that I have a txt file with a pattern which i want to sort.

Consider the following string

JavaScript

So all the lines are seperated and the pattern is the same. What i want to do now is to make 3 lists one for url one for cust and the last for number.

I have basically no idea how to do that as there is no pattern which I could search for with regex. So my idea was to do something like this:

JavaScript

And this i would do for all the 3 lists. Is there some other easier and more advanced solution?

Advertisement

Answer

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement