Results 1 to 5 of 5
hi every body:
please help me ,
what is the command to retrieve words between { and }.
example the page is like this:
I am working on {linux}
{unix} ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-24-2005 #1Just Joined!
- Join Date
- Nov 2005
- Location
- pune
- Posts
- 3
help needed: what is the command to retrieve words between { and }.
hi every body:
please help me ,
what is the command to retrieve words between { and }.
example the page is like this:
I am working on {linux}
{unix} {linux} are similar to each other
{linux}{solaris}{HP-AIX} are the different flavors of {unix}
so the output should be :
linux
unix
linux
linux
solaris
HP-AIX
unix
please help me by providing the command to retrieve words present in between " { "and " } ".
with Regards and Thanks,
Rajesh
- 11-24-2005 #2Just Joined!
- Join Date
- Jul 2004
- Posts
- 94
The command you are looking for is char *rtvtbbr(const char* s), which stands for "retrieve text between braces." Just "man" that function on your system.
*****
Sorry, your question is quite ill-stated, and I could not resist. In what language are you programming? If I were to solve the same problem, I would just write a function that would check the input string for an opening brace, then look for the corresponding closing brace, and then copy the substring to a destination string.
However, if you already know what strings might be found between the braces, you can use the function char *strstr(const char* haystack, const char *needle) to extract the text without writing any custom function yourself. Just "man" that function.
- 11-24-2005 #3Just Joined!
- Join Date
- Nov 2005
- Location
- pune
- Posts
- 3
help needed: new to unix environement
hi every body:
I am new to solaris(UNIX) environement.
please help me ,
what is the command to retrieve words between { and }.
example the page is like this:
I am working on {linux}
{unix} {linux} are similar to each other
{linux}{solaris}{HP-AIX} are the different flavors of {unix}
so the output should be :
linux
unix
linux
linux
solaris
HP-AIX
unix
please help me by providing the command to retrieve words present in between " { "and " } ".
with Regards and Thanks,
Rajesh
- 11-24-2005 #4Linux Newbie
- Join Date
- Jul 2005
- Location
- Chd,India
- Posts
- 135
Why did u type your post again
If u were trying to do that in perl,you could do this
Code:@list = /{([^}])*}/g; print "@list";
The strong shall live and the weak will die
In the end,only the fittest survive in this world
- Shishio Makoto
- 11-25-2005 #5Just Joined!
- Join Date
- Nov 2005
- Location
- pune
- Posts
- 3
hello sir,
I tried the command /{([^}])*}/g but not working on solaris bash shell.
actually I ahve to retrieve some prompts present in differnet pages and the page format would be same as given in the example.
so I gave the command (being in that directory where the pages are available)
grep { * | cut -f 2 -d "{"
and the output is like this(for above given example)
linux}
unix} {linux} are similar to each other
linux}{solaris}{HP-AIX} are the different flavors of {unix}
well If I use another cut operation I will get these:
linux
unix
linux
but I also want solaris and HP-AIX to be displayed, which are present in the same line.
well in my actual files I dont know what are the words present .
please help me by providing the command to retrieve words present in between " { "and " } ".


Reply With Quote
