Hi Eily, I have read the reply of ww, but I don't understand what he means. I have applied the suggestions and I have modified my code but I can not see an answer to my question in my previous topic. As I have said, I have little experience with perl, but I have read about Regex and I thought, that this forum is a place where I can get help.
But now I have the impession to be blamed for my questions. I am german and may be I don't understand every nuance of your replies. And I have never posted on the internet before, so it is possible that I did something wrong, but I think it would be polite to tell me what was wrong with my second question. For me there was a new problem, because the code worked with the first test-inputfile but not with the second one. I would appreciate an answer to this reply.
Your second question above was an almost exact duplicate of the question here. Such a duplicate can lead, as it has here, to needless duplication of effort on the part of the humble Monks working to answer your questions. Such a duplicate can also make it harder for other Seekers of Wisdom to follow the discussion in the future; one of the important goals of this site is teaching and learning.
I have applied the suggestions and I have modified my code but I can not see an answer to my question in my previous topic.
Unfortunately, your only description of your current problem is "it doesn't work." This is almost useless. Please describe what your code now is and how it does not work. Please see Short, Self Contained, Correct (Compilable), Example for ways to do this briefly and clearly.
... I can not see an answer to my question in my previous topic.
Have you studied this closely? If not, please do. How does it not address your present situation? Please answer there!
The post I have linked to in my previous post is nearly the same (typos included) as the first one of this thread, so you can't say this is a new problem. AnomalousMonk gave you an answer (which is basically the same as mine, except more complete and correct), but you haven't answered back. So all we could do is tell you the same thing as he did, but if you don't give any information on why his answer doesn't fit your problem, or don't tell us that you didn't understand it, we can't help you any further. The test that AnomalousMonk run seems to demonstrate that it does work for your input data, did you actually try it?