[SOLVED] Need help to extract substrings from a text file, based on patterns.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can you give us an example of the output which you want to get (i.e. you write it yourself like you want the program to print it) and then show us the output you're getting from druuna's code? That way we can have a better idea of what the "problem" with druuna's code is.
That's exactly what druuna's code does. You need to explain it in more details:
1. You said we only need to take into consideration words inside the ctr{...} tags. (OK)
2. It lists those words and prints the number of occurrences. (OK)
druna i beleive you are agreat programmar but your code gove me syntaz error
1. Copy druuna's code and paste it into your terminal. Don't retype it as you might have made some typos.
2. If it gives you errors. Please copy/paste the command/errors here.
You saying that it gives you errors doesn't tell us much. We are not mind readers.
awk:syntax error near line 1
awk:illegal statment near line 1
awk:syntax error near line 1
awk:illegal statment near line 1
awk:bailling out near line 1
awk:syntax error near line 1
awk:illegal statment near line 1
awk:syntax error near line 1
awk:illegal statment near line 1
awk:bailling out near line 1
How exactly are you running the code? Are you running it on windows?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.