14 Topics
|
|
Hello Everybody, I am trying to run a simple script to monitor a log file, where I need to send an alarm every time specific line is being written into this log file, currently my script is working fine, the problem is with the miltiple lines that is being written … |
|
I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line. File 1: hgacdavd sndm,ACNMSDC msgid "Rome" msgstr "" kgcksdcgfkdsb msgid "" hsdvchgsdvc msgstr … |
|
I'm just trying to figure out how to get everything after the first two words in a line. Right now, I've got the opposite - the first two words themself: ^(\S+ \S+) I want the opposite of this. Thanks! |
|
Hi Can anyone explain me the following command. This may be a minor one, but, please do explain in detail. CHKTRANS=`echo ${0} | grep '/transforms/' | wc -l` |
|
When using the Grep command to find a search string in a set of files, is there a way to dump the results to a text file? Also is there a switch for the Grep command that provides cleaner results for better readability, such as a line feed between each … |
|
Hi, I have a HTML page in one variable. I need build a mehod that will extract a tag content (dif extract_tag(self, tag_name)). For example, given webpage: <div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <!-- content --> <div id="content" class="mw-body"> <a id="top"></a> <div id="mw-js-message" style="display:none;"></div> <!-- sitenotice --> <div id="siteNotice"><!-- centralNotice … |
|
Hi i want to grep for two different patterns in the same file and diff the results(without needing to store them) I amnot able to get diff to accept the output of the two greps as arguments. Any help? Thanks for your time. |
|
After running the command [CODE] find . -name "R*VER" -mtime +1 -exec sh -c 'grep -H ^err "{}" || echo "{}:No error"' \;[/CODE] my files look like this [CODE] RRR1~COS~COSMETICS~40048~jgmdtv113~1~P~R22-200~029053662549~20110607~102151.VER No error RRR1~COS~COSMETICS~ETT03~jgm14652.~3~F~R16-500~000907009757~20110607~085109.VER err 3922 [/CODE] Using the tilde (~) symbol as delimiter in the file name, can I extract … |
|
Hi, I have a folder containing a further 2500 folders or so. These all contain files. I want to move the files from within only a selection of around 260 of these folders into a new folder. I have a text list of the folders of interest. So basically I … |
|
This is inspired for recent poster, who asked to check multiple strings in multiple files. |
|
I am supposed to find a file recursively in a given directory. Rules are not to use find and recursive options like ls -R and grep -r. I can any other other option expect recursive. I had written the script using recursion. [CODE]#!/bin/csh foreach i (`ls -R $1 | grep … |
|
Hi, I am trying to get to use the grep function in perl, I have been searching web pages but can't get a simple example. I am reading in a .csv file with 7 columns and loads of rows, this is done with: [code] $dat_file = 'sample.csv'; [/code] In the … |
|
Hello, I currently have the following python code: [CODE] #usr/bin/python import os variable=raw_input('Search for this string: ') os.system("grep $variable sample.txt") [/CODE] Basically what I want to do is to grep a string found in the text file "sample.txt" When I run the code, it just hangs. How can I make … |
|
Hello all. I was trying to do some text recovery ([url]http://www.cyberciti.biz/tips/linuxunix-recover-deleted-files.html[/url]) but after running grep -b 'TEXT' /dev/ad0 > good.txt i only see "Binary file /dev/ad0 matches" in the good.txt, whats wrong here ? =) Thanks in advance. |
The End.