|
[Sponsors] |
September 14, 2004, 07:11 |
egrep command
|
#1 |
Guest
Posts: n/a
|
Hello,
Does somebody know how to use the command egrep for extracting the needed values from a file (.info file, for example)? Regards, Julie |
|
September 14, 2004, 14:07 |
Re: egrep command
|
#2 |
Guest
Posts: n/a
|
egrep is an older version of the command. You can get equivalent functionality by using grep -E.
I do not know what kind of values you wish to extract, and what a .info file is. grep is used to find occurrences of a textual pattern in a file or files. It lists to the standard output each line that contains the pattern. The simplest syntax is grep 'pattern' filename where 'pattern' is a textual string or more generally a regular expression that may contain wildcard characters such as '*', and other constraints. Type 'man grep' to find the options available with the grep command. The usual uses for grep are to check which files a pattern occurs in (grep 'subroutine flux' *.f), or which lines of a large file a pattern occurs in (grep -n 'subroutine' myHugeFile.f). grep -i will cause grep to ignore the case of the letters when determining a match. grep can be used in conjunction with other unix text processing commands, by piping or by redirecting output to a file. For example, grep -i 'subroutine' myCFDcode.f | wc -l will tell you how many lines contain one or more occurrences of the word 'subroutine', not caring for case. However, for more complex text processing needs, you will need tools like 'sed' and 'awk'. For industrial strength text processing, you have to turn to languages like Perl or Python. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 | flakid | OpenFOAM Installation | 16 | December 28, 2010 08:48 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 02:32 |
OpenFOAM15 installables are incomplete problem with paraFoam | tryingof | OpenFOAM Bugs | 17 | December 7, 2008 04:41 |
Regarding FoamX running Kindly help out | hariya03 | OpenFOAM Pre-Processing | 0 | April 18, 2008 04:26 |
egrep command | Julie | Siemens | 2 | September 14, 2004 17:05 |