Sponsored Content
Top Forums Shell Programming and Scripting Find keywords in multiple log files Post 302974820 by Don Cragun on Friday 3rd of June 2016 06:19:22 PM
Old 06-03-2016
We are lost here.
You have uploaded four sample files: file1.log.02896.txt, file2.log.02897.txt, filew.log.02820.txt, and filez.log.02899.txt
None of these files are referenced in any of your posts in this thread.

You have referenced files with names (or names that match pathname matching patterns) *.log, progflag.cvs, progflag.cvs.txt, and several others; but you have not shown us samples of the contents of any of these files.

You have shown us some code and you have sort of said what some of that code is trying to do, but the syntax is so different from the syntax expected by awk and bash and your explanations are not in complete sentences, so I am unable to figure out the format of your input files and I am unable to figure out the logic you are trying to use to produce the output you want.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find particular string in multiple files

Hello friends, I have find a paticular string from the files present in my user for example: a username and password is hardcoded in multiple files which present in the my user.so I have to search about username in which files it is available.there are several dirctories are there,so... (5 Replies)
Discussion started by: sivaranga001
5 Replies

2. Shell Programming and Scripting

Finding 50k Keywords in 3k files

Hi, I have a file with about 50k keywords. I have a requirement to scan about 3k files to identify which filename has which keyword i.e. an output like following: File1,Keyword1 File1,Keyword2 File3,Keyword1 ..... I have written a shell script which takes each of the 3k files, searches... (4 Replies)
Discussion started by: rjains
4 Replies

3. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

4. UNIX for Dummies Questions & Answers

finding keywords in many files using grep

Hi to all Sorry for the confusion because I did not explain the task clearly. There are many .hhr files in a folder There are so many lines in these .hhr files but I want only the following 2 lines to be transferred to the output file. The keyword No 1 and all the words in the next line They... (5 Replies)
Discussion started by: raghulrajan
5 Replies

5. UNIX for Advanced & Expert Users

Need to search for keywords within files modified at a certain time

I have a huge list of files in an Unix directory (around 10000 files). I need to be able to search for a certain keyword only within files that are modified between certain date and time, say for e.g 2012-08-20 12:30 to 2012-08-20 12:40 Can someone let me know what would be the fastest way... (10 Replies)
Discussion started by: virtual123
10 Replies

6. Shell Programming and Scripting

Find keywords, and append at the end of line

Task: Find keywords in each line, and append at the end of line; if not found in the line, do nothing. the code is wrong. how to make it work. thanks a lot. cat keywords.txt | while read line; do awk -F"|" '{if (/$line/) {print $0"$line , ";} else print;}' outfile.txt > tmp ... (9 Replies)
Discussion started by: dtdt
9 Replies

7. Shell Programming and Scripting

Search files in directory for keywords using bash

I have ~100 text files in a directory that I am trying to parse and output to a new file. I am looking for the words chr,start,stop,ref,alt in each of the files. Those fields should appear somewhere in those files. The first two fields of each new set of rows is also printed. Since this is on a... (7 Replies)
Discussion started by: cmccabe
7 Replies

8. UNIX for Dummies Questions & Answers

Find keywords in multiple log files

The Problem that I am having is when the code ran and populated the progflag.csv file, columns MEMSIZE, SECOND and SASEXE were blank. The next problems are the IF else statement isn't working and the email function isn't sending the progflag.csv attachment. a. What I want the program to do is to... (2 Replies)
Discussion started by: dellanicholson
2 Replies

9. Shell Programming and Scripting

Grep multiple keywords from a file

I have a script that will search for a keyword in all the log files. It work just fine. LOG_FILES={ "/Sandbox/logs/*" } for file in ${LOG_FILES}; do grep $1 $file done This only works for 1 keyword. What if I want to search for more then 1 keywords, say 4 or maybe even... (10 Replies)
Discussion started by: Loc
10 Replies

10. UNIX for Beginners Questions & Answers

Find and replace from multiple files

Hello everybody, I need your help. I have a php site that was expoited, the hacker has injected into many php files a phishing code that was discovered and removed in order to have again a clean code. Now we need to remove from many php files that malware. I need to create a script that find and... (2 Replies)
Discussion started by: ninocap
2 Replies
CVS2HTML(1)						       Debian user's manual						       CVS2HTML(1)

NAME
cvs2html - render a CVS commit log in HTML SYNOPSIS
cvs2html [-a[-b][-k]] [-n numdif] [-l/-L home] [-e] [-f] [-d MMM DD [YYYY]] [-D DD] [-i image]] [-h] [-v] [-w framewidth] [-s percentage] [-N maxchrono] [-rrev1:rev2] [-c|-C cfilename] -O | -o htmlname [-p cvspath] [-v verbosity] DESCRIPTION
The cvs2html script fetches the commit log for a CVS module and renders it in HTML. -a Generate additional fields and files containing differences between versions in an xdiff-like side by side manner. -b Use spaces as breakpoints to wrap the text, if -a is specified. This is used to stop the two columns from exceeding the total width. -c | -C filename Save a chronologically sorted list of all log entries in html format in filename. Use -C to reverse-sort the file. -d MMM DD [YYYY] Omit all log messages prior to the given date. The first three letters of the month should be used (eg Jun 5). The year is optional. -D DD Omit all log messages older than DD days. -e Print log messages in courier (non-proportional) font. -f Generate individual log files for each file when using -o. -h Show help -i image Make image the background image. -k Ignore changes in lines caused by CVS-keyword substitutions when -a is specified. -l home Make links relative to home. -L home Make links relative to home, but substitute file extensions with .html. -n numdiff Output only the latest numdiff diffs in the log. Older commits will only have the log data displayed. -N maxchrono Show only the latest maxchrono file changes in the chronological list of changes. -o output If output is a directory, all html files produced are stored there, using the name of the repository as the base filename. Other- wise, output is used as the base name. Generate frames for easier browsing. -O output If output is a directory, all html files produced are stored there, using the name of the repository as the base filename. Other- wise, output is used as the base name. -P cvspath Set the cvs path to cvspath. -rrev1:rev2 Show only the log messages between rev1, and rev2. If a file isn't tagged, then the whole revision story of the file is shown. -s percentage Make the width of the left frame, percentage of the window. -v Insert CVSROOT information in the index. -V verbosity Set the verbosity. The higher verbosity is, the more output is printed out. -w framewidth Make the width of the left frame, framewidth pixels. EXAMPLE
cvs2html -l http://cvs.sslug.dk/linuxbog -f -p \ -o cvs2html/index.html -v -a -b -n 6 -C chrono.html Will create a directory called cvs2html directory. This directory will contain a log data file, for every file in the repository. The last 6 commits to every file will have a diff available. All links will be relative to http://cvs.sslug.dk/linuxbog. It will also create a file with all the log data in it, in chronological order. AUTHORS
The cvs2html script was written by Peter Toft and others (see the comments in /usr/bin/cvs2html for an exhaustive list). This manual page was written by Antti-Juhani Kaijanaho for Debian GNU, and modified by Pascal Hakim. SEE ALSO
The file /usr/share/doc/cvs2html/help.txt. The source code to cvs2html, in /usr/bin/cvs2html. cvs(1) Debian Project 1999-12-10 CVS2HTML(1)
All times are GMT -4. The time now is 01:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy