14 Topics

Member Avatar for
Member Avatar for fo2sh

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 …

Member Avatar for rproffitt
0
423
Member Avatar for Madira

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 …

Member Avatar for Madira
0
353
Member Avatar for turpentyne

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!

Member Avatar for L7Sqr
0
236
Member Avatar for asrsmunna

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`

Member Avatar for sepp2k
0
322
Member Avatar for techman41973

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 …

Member Avatar for JeoSaurus
0
297
Member Avatar for sarelnet

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 …

Member Avatar for ryantroop
0
249
Member Avatar for voidyman

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.

Member Avatar for AnkushChander
0
122
Member Avatar for kristo5747

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 …

Member Avatar for kristo5747
0
208
Member Avatar for BioJavaPhobic

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 …

Member Avatar for roswell1329
0
191
Member Avatar for TrustyTony
Member Avatar for TrustyTony
0
905
Member Avatar for naiksuresh

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 …

Member Avatar for naiksuresh
0
104
Member Avatar for niall_heavey

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 …

Member Avatar for niall_heavey
0
168
Member Avatar for jl487

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 …

Member Avatar for TrustyTony
0
11K
Member Avatar for jen140

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.

0
117

The End.