![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search a pattern in a file with contents in a single line | sparks | Shell Programming and Scripting | 4 | 03-17-2009 02:51 AM |
| find pattern, delete line with pattern and line above and line below | nickg | Shell Programming and Scripting | 4 | 01-29-2009 01:38 PM |
| find pattern delete line with pattern and line above and line below | nickg | UNIX for Dummies Questions & Answers | 1 | 01-28-2009 06:46 PM |
| Split File Based on Line Number Pattern | shankster | Shell Programming and Scripting | 11 | 10-01-2008 10:49 AM |
| how to move the line after a certain pattern in the file | aoussenko | Shell Programming and Scripting | 5 | 09-03-2008 04:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi Guyz,
I have a flat file with some data as below:- Quote:
My desired output:- Quote:
Tried a lot, but not getting the desired result. Thnx in advance. |
|
||||
|
There is overreliance on awk. There are cases in which files are very large (log files) and using awk can literally take minutes to process such files. The most efficient way is to use regular expressions. Try this: Code:
grep 'XYZ>..*</XYZ' filename |
|
||||
|
Quote:
What do you think this will do? What is the requirement? Did you test it? This will just list all the lines once again. That will be garbage-in-garbage-out. |
|
||||
|
Quote:
This is it: Code:
cut -d \> -f4 filename | cut -d\< -f1 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|