I want to search a file for a string and then if the string is found I need the line that the string is on - but also the previous two lines from the file (that the pattern will not be found in)
This is on solaris
Can you help? (2 Replies)
Hi,
I'm looking for a single command that will be able tell me which files in a directory don't contain a certain pattern e.g. regular expression
I've tried a combination of ls, xargs and grep but I haven't come up with anything yet. :confused:
I would appreciate any help.
Thanks (2 Replies)
Hi All,
I have two directories as
1) mi/job -> job1.sh, job2.sh, job3.sh
2) mi/sysin -> sysin1, sysin2, sysin3,sysin4
I want to wrrite a script such that it should accept two parameters as directory paths.
$ myscript mi/sysin mi/job.
The script should be able to scan all files... (3 Replies)
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
Here Is a problem I am facing with awk.
Query --> I want to search for a string in a file and print next 15 lines below the matched string.
1.We do not have GNU grep so cannot use grep -A or grep -B commands.
2. Instead of passing the search pattern as a string to awk. I want the awk to... (4 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Hi I want to search pattern in file "S12345678B" which start with S and end with B total length is 10,numeric part 12345678 is variable.
e.g S99001229B and S88226901B.
please help (2 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT DEBIAN
sc_warts2text
SC_WARTS2TEXT(1) BSD General Commands Manual SC_WARTS2TEXT(1)NAME
sc_warts2text -- simple dump of information contained in a warts file.
SYNOPSIS
sc_warts2text [-d ip2descr-file] [file ...]
DESCRIPTION
The sc_warts2text utility provides a simple dump of information contained in a sequence of warts files. The output is the same as that which
would have been provided by scamper if the text output option had been chosen instead of the warts output option when the data was collected.
The options are as follows:
-d ip2descr-file
specifies the name of a file with IP-address, description mappings, one mapping per line. See the examples section for further
information.
While the output of sc_warts2text is structured and suitable for initial analyses of results, the format of the output is not suitable for
automated parsing and analysis as the output of sc_warts2text will change overtime with no regard to backwards compatibility. Analyses of
the contents of a warts file should be made using specialised programs which link against the scamper file API.
EXAMPLES
The command:
sc_warts2text file1.warts file2.warts
will decode and print the contents of file1.warts, followed by the contents of file2.warts.
The command:
gzcat file1.warts.gz | sc_warts2text
will print the contents of the uncompressed file supplied on stdin.
Given a set of IP-address, description pairs in a file name mappings.txt:
192.0.2.1 "foo"
192.0.2.2 "bar"
then the command gzcat file1.warts.gz | sc_warts2text -d mappings.txt will print the description associated with a given destination address
before each result is presented.
SEE ALSO scamper(1), sc_wartsdump(1)AUTHORS
sc_warts2text is written by Matthew Luckie <mjl@luckie.org.nz>.
BSD October 15, 2010 BSD