I have the need to check content of very many files for a block of text.
I know the data should match for instance/as an example the following
In the first step, I isolated the interesting data by using sed to print everything between "The list of characters" and the "/"
Now I want to match the entire block by using whats shown above to ensure that the isolated block matches exactly line by line.
If the test block shown above, doesn't match the file containing the isolated and interesting data set a flag to no.
If the test block shown above does match the file containing the isolated and interesting data, set a flag to yes.
I would prefer to do this with sed, awk or ksh. The linux box Im working on has limited perl modules loaded.
The only thing I can think of at this point is loop through the files, then grep each file for every line using the known good data set. That will tell me if a particular lines exists, but wont tell me if the entire block is matched exactly.
Thanks
Last edited by vbe; 09-09-2013 at 08:14 AM..
Reason: code not quote tags...
HI ,
I WANT TO RETRIVE IN BETWEEN DATA FROM PARENTHESIS AND I AM GETTING ERRORS WHILE RUN THE AWK.I HAVE 2 FILES AND WANT TO PROCESS 1ST FILE PATTERN TO 2ND FILE AND WRITES INTO OUTPUT FILE.THIS TIME I AM PUTTING WHERE EXACTLY I AM GETTING ERRORS.SO PLEASE HELP.
PATTERN_FILE.TXT
--------------... (1 Reply)
Hi,
In order to make our debugging easier in log files, I need this script.
My log file will be structured like this :
------Invoking myfile -param:start_time=1371150900000 -param:end_time=1371151800000 for 06/14/2013
<multiple lines here>
.....
- Step Sybase CDR Table.0 ended... (3 Replies)
I want to process a file block by block using sed, and if that block does not contain two patterns, then that complete block has to be printed.
See below for the example data.
................................server 1...............................
running process 1
running... (8 Replies)
Hi all,
I have a file with Id which I want to compare it with other file to get the sequence of a particular id.
File 1 with ID
Q7L8J4
Q676U5
Q8NAA4
Q5TYW2
Q5SQ80
Q5VUR7
Q4UJ75
Q96IX9
Q7Z4T9
Q6NTF7
Q8IZP0
Q9NYB9
Q9P2A4
O14639
Q9ULW3 (5 Replies)
I figured this would be simple, but I am stuck.
Variable longpath="/dir1/dir2/dir3/filename.stuff.morestuff.garbage"
I want to end up with just "filename.extra.moreextra". So, I want to get rid of the path and .garbage
I want to do this with just ksh internals. So, no sed,grep,awk,expr,... (4 Replies)
Hi,
Can anyone help me to compare two files and get the matching data... say i have file1 and file2 ... file1 has 300 unique data with that i need to match with file2 to see how may are matching.. file2 have 1000 records. (4 Replies)
In ksh is there a was to scroll thru all matching commands? For example I executed several commands over several days. Is there a way to scroll thru all the matching 'find' commands only that was executed?
No messing with the .history file. Anyway to do this from the command prompt? TIA. (3 Replies)
Hi,
Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent.
E.g : username empid
------------------------
sri 123
to
username,empid
sri,123
Thanks,
Hema:confused: (2 Replies)
I try to use the pattern substitution operators as documented in the O'Reilley "Learning the Korn Shell" but it doesn't seem to work as advertised.
This works all right:
var='Regular expressions rules!'
$ echo ${var//e/#}
R#gular #xpr#ssions rul#s!
The docs says that using !(expr)... (5 Replies)