I want to process a text file in order to extract desired data using sed and grep... Now I am facing a problem piping to grep... nothing happens..
The text consists of blocks of 3 lines that may (or not) contain the Desired data.
the desired data is on each 2 first lines of some 'blocks'.. so I started by using the following so as to join the desired 2 lines in 1 (and skip the 3rd) in order to use it after with grep/sed :
Now I want to select only the lines containing the "DesiredInfo", for that I thought simply of adding a pipe to grep after the preceding code:
but.. it doesn't work like that...(nothing happens) so I thought of putting directly in the shell prompt instead of the script:
Actually I found that the 'problem' was that it took so much time (50 sec.) to display the result that I thought it was not working... but in fact it was ok
Hi,
I am trying to search for a string in a file and print all the matched lines as pipe delimited format.
My command is
cat m_gid_trans.XML|grep -i '<TABLEATTRIBUTE NAME ="Lookup cache directory name"'
The output I am getting is
<TABLEATTRIBUTE NAME ="Lookup cache directory name"... (4 Replies)
comm -13 tmpfile tmpfile2 | grep -v <filename> >newfile
so i want to
1. find records in 1 file bot not in another
2. The output of the first part is 1 field in a file with many fields.
3. find all the records that do not have the value piped from step #1
4. redirect to a new file
... (4 Replies)
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
We have a number of OS X 10.6 machines who have home folders with incorrect permissions, which are causing managed prefs not to be applied correctly and not allowing saving. I need to delete all home folders whose name is numerical and modified before a certain date. I'm not sure of the date part... (2 Replies)
Trying to create a command line script to look for all files matching a pattern, grep for a specific value in each file, and write out the filename long list. It's possible the filename won't containe the value.
{
echo “Running....”
for fname in 811_Intermediate_File_*
do
grep -l... (3 Replies)
I am ptting the following into an FTOP script.
date=`TZ="aaa24" date +'%Y%m%d'` # this gets Yesterday date
.
.
.
.
mput < 'l | grep $Vdate'
# the idea to grep a listing from a directory that has yesterday date in its file name then put it in the remote FTP server. How can I get it... (4 Replies)
Is there a way I can do this:
search for text and replace line containing matched text with a different line?
For example:
"I want to replace text"
I want to search for replace and then change the line to
I am perplexed.
Hope that makes sense.
Thanks in advance. (4 Replies)
Hi all,
Can someone help me with the following problem.
I am executing the following command:
(search for occurences of 'error' in files that match cl-*.log expression)
> grep -cw -i --max-count=1 'error' cl-*.log
this command outputs:
cl-apache.log:1
cl-apache_error.log:1... (3 Replies)
ls -ltr | grep string
How can I use regular expressions to filter the results provided even more. I am using the above command as a reference. (1 Reply)