I was trying to do this to all files ending with .txt in my destination directory using the following code :
the given awk code works well for a single file even made with run time arguments but to make this dynamic for all files its not getting achieved.
What my code does is - making all .txt files to empty.
Can you please tell where i'm going wrong in the code
I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word.
eg:
line1
line2
line3
line4
line5
line6
"particular word"...
I would like to delete line2-line6 and all such occurences in that... (4 Replies)
I want to delete all lines from a file (orig_file) that contain the regex values (bad_inv_list)
I tried a for each loop with sed but it isn't working
for file in `cat bad_inv_list`;
do
sed '/$file/d' orig_file > pared_down_file.1
mv pared_down_file.1 orig_file
done
I've added... (2 Replies)
I know this is a complicated question but I will try to illustrate it with some data. I have a data file that looks like the following:
1341 NA06985 0 0 2 46.6432798439
1341 NA06991 NA06993 NA06985 2 48.8478948517
1341 NA06993 0 0 1 45.8022601455
1340 NA06994 0 0 1 48.780669145
1340... (1 Reply)
Hello,
I have a file filled with dates, such as:
04-08-2011 message
04-08-2011 message
03-08-2011 message
01-08-2011 message
31-07-2011 message
24-07-2011 message
15-07-2011 message
13-12-2008 message
26-11-2007 message
And I want to delete those lines whose date is older than 10... (5 Replies)
Hi,
I have a file with 20 columns of data and hundreds of lines of the same format.
Here is an example line. The data repeats underneath with the same format.
15 1 4 GLY - 1 65 LYSH 23 N - 24 H - 634 O 0.188 157.552 487 48.70I have been sorting this data by hand but I was wondering if I... (3 Replies)
I'm trying to create a script.
There are 2 files - fileA.log & fileB.log
fileA.log has the below data :
aaaa
cccc
eeee
fileB.log has the below data :
cjahdskjah aaaa xyz
jhaskjdhas bbbb abc
ajdhjkh cccc abc
cjahdskjah ... (7 Replies)
Discussion started by: Pandee
7 Replies
LEARN ABOUT DEBIAN
visgrep
VISGREP(1) General Commands Manual VISGREP(1)NAME
visgrep - Visual grep, greps for images in another image
SYNOPSIS
visgrep [options] image.png detect.pat match.pat ...
DESCRIPTION
visgrep is a program that greps for image in another image.
All .pat files are created using png2pat(1) or rgb2pat(1). The image.png is scanned for detect.pat starting from X,Y given in parameters.
When detect.pat is found, then all the match.pat files are scanned at an offset of x,y given in parameters. If a match is found, then vis-
grep prints the x,y and index of the item.
For example, image.png is a screenshot and match1.pat .. match5.pat are images of letters a to e. Each of these letters is enclosed in a
blue box, so detect.pat is an image of the upper left corner of the box. This box is not included in the match*.pat files, so they are
actually offset 5 pixels down and 4 pixels to the left. You might run it like this then:
visgrep -x-4 -y5 image.png match_corner.pat match_a.pat match_b.bat ...
Etc, with all matches listed. Now suppose the screen showed ace so visgrep might output:
10,10 0
50,10 2
90,10 4
Showing that match_a.pat (index 0) is at 10,10 on the screen. If no match is found even though the detection image is found, the index will
be -1.
OPTIONS
A summary of options is included below.
-h Show summary of options.
-x Set x offset for detection matching.
-y Set y offset for detection matching.
-X Start scanning at X.
-Y Start scanning at Y.
-t Set tolerance for 'fuzzy' matches, higher numbers are more tolerant.
EXIT STATUS
0 at least one match was made.
1 no matches were made.
2 an error occured.
SEE ALSO pat2ppm(1), patextract(1), png2pat(1), rgb2pat(1), xte(1).
AUTHOR
visgrep was written by Steve Slaven <bpk@hoopajoo.net>.
This manual page was written by Aurelien Jarno <aurel32@debian.org>, for the Debian project (but may be used by others).
April 20, 2004 VISGREP(1)