I am working with CVS log data and have some data as follows.
A block starts with the word RCS and ends with the pattern ======
I used the following command
awk '/.java,v/,/====/'
and it extracted all the blocks of data for java files i.e. starting and ending with the pattern ======. This is good.
However, I also want to extract some more information from each block and store that also.
For example, I want to count how many revisions are there in each block, how many distinct authors worked on that file, how many lines added/deleted in total for each file, etc.
Can anyone help me out how to extract this information from each block and store that in a tab separated file? Even if I do not get the values of the individual revisions/author names, etc. it is ok. I just want to get the count for revisions (total or the sum of lines added, etc).
Any starting help on even how to work with these individual blocks will be useful. Do I have to use some for loop to work with each block?
Although I am not very well versed in Awk and perl, I understand the code that you have given. I will work on these and try to get the other things I want using what you have written.
Hi All
I have a list of files which will have duplicate list of blocks of text. Following is a sample of the file, I have removed the sensitive information from the file.
All the code samples starts from <TR BGCOLOR="white"> and Ends with IP address and two html tags like this.
10.14.22.22... (3 Replies)
Hello all,
short story: I'm writing a script to add and remove dns records in dns files. Its on a RHEL 5.5
So far i've locked up the basic operations in a couple of functions:
- validate the parameters
- search for existant ip in file when adding
- search for existant name records in... (6 Replies)
Hello to all, happy new year 2013!
May somebody could help me, is about a very similar problem to the problem I've posted here where the member rdrtx1 and bipinajith helped me a lot.
https://www.unix.com/shell-programming-scripting/211147-map-values-blocks-single-line-2.html
It is very... (3 Replies)
In any given file, wherever a certain data block exists I need to concatenate the values(text after each "=" sign) from that block. in that block. The block starts and ends with specific pattern, say BEGIN DS and END DS respectively. The block size may vary. A file will have multiple such blocks.... (12 Replies)
Hello,
I have a file like this:
FILE.TXT:
(define argc :: int)
(assert ( > argc 1))
(assert ( = argc 1))
<check>
#
(define c :: float)
(assert ( > c 0))
(assert ( = c 0))
<check>
#
now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
Hi,
I have file which contains information written in blocks (every block is different). Is it possible to read every block one by one to another file (one block per file).
The input is something like this
<block1>
<empty line>
<block2>
<empty line>
...
...
...
<block25>
<empty... (0 Replies)
Hi,
This is part of a large text file I need to separate out.
I'd like some help to build a shell script that will extract the text between sets of dashed lines, write that to a new file using the whole or part of the first text string as the new file name, then move on to the next one and... (7 Replies)
Hi,
This script is working successfully when i executed from shell prompt, but the same script scheduled in crontab its not deleting the files,
#! /bin/bash
DAY_1=`(date --date='4 months ago' '+%Y-%m')`
log=/tmp/cleant
adir=/u01/app/oracle/admin/talon/adump... (4 Replies)