Search Results

Search: Posts Made By: KCApple
2,682
Posted By Akshay Hegde
Try [akshay@nio tmp]$ cat file <a...
Try

[akshay@nio tmp]$ cat file
<a href="linux">Linux</a>
<a href="unix">Unix</a>
<a href="oracle">Oracle</a>
<a href="perl">Perl</a>
[akshay@nio tmp]$ grep -oP '(?<=>).*(?=</a>)' file
Linux...
2,682
Posted By RavinderSingh13
Hi KCApple, Following awk solution may help...
Hi KCApple,

Following awk solution may help you which is very easy too.


awk -F["><"] '{print $3}' Input_file


Output will be as follows.

Linux
Unix
Oracle
Perl


EDIT: Just...
2,682
Posted By Aia
Would you use the butter knife to carve the...
Would you use the butter knife to carve the turkey at dinner time?
grep is not the tool for what you want to learn.
What you want to learn is Regular Expressions, which ironically, it is not the...
2,682
Posted By shamrock
Any reason to insist on grep instead of sed or...
Any reason to insist on grep instead of sed or awk for parsing your input...
sed 's/\(.*>\)\(.*\)\(<.*\)/\2/g' file
or
awk -F"[<>]" '{print $3}' file
3,285
Posted By vidyadhar85
You might have to go through the man page for...
You might have to go through the man page for more details..
Below is one of the example where I used FILENAME in awk.. As you can see I have used 4 files here, depending upon filenames I had to...
3,285
Posted By vidyadhar85
Yes you can it all depends what you wanna do with...
Yes you can it all depends what you wanna do with them?
You can use FNR or if you have more than 3 use FILENAME it will make your code more presentable.. :)
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 06:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy