Sponsored Content
Full Discussion: Report Generation with Grep
Top Forums Shell Programming and Scripting Report Generation with Grep Post 302409811 by frans on Friday 2nd of April 2010 04:38:42 PM
Old 04-02-2010
If the xxx_load and xxx_unload files have always the same structure, i think it would be better to read them sequentially.
I believe the best way is to write a script with a for loop like
Code:
for FILE in $(ls file*_dat)
do
  {
    read X X UnldSt
    read Unld X
    read X X UnldEd
  } < ${FILE%_dat}_unload
  {
    read X X LoadSt
    read X X Load
    read X X LoadEd
  } < ${FILE%_dat}_load
  # Calculate the time differences given in seconds
  UnldDT=$(( $(date -d UnldEd +%s) - $(date -d UnldSt +%s) ))   # Works if you have GNU date
  ((UnldDT<0)) && ((UnldDT+=86400))
  LoadDT=$(( $(date -d LoadEd +%s) - $(date -d LoadSt +%s) ))
  ((LoadDT<0)) && ((LoadDT+=86400))
  echo "$(ls -lrt $FILE) $Unld $UnldSt $UnldEd $UnldDT $Load $LoadSt $LoadEd $LoadDT"
done


Last edited by frans; 04-02-2010 at 05:45 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Oracle Report generation

Hi, I am beginner in shell programming.In a shell script i found a call to a script 'runrep25m',which i think is to generate oracle reports?Could anyone help me by providing some details about its usage With Thanks & Regards Dileep (7 Replies)
Discussion started by: DILEEP410
7 Replies

2. Shell Programming and Scripting

awk- report generation from input file

I have input file with below content: Person: Name: Firstname1 lastname1 Address: 111, Straat City : Hilversum Person: Name : Fistname2 lastname2 Address: 222, street Cit: Bussum Person: Name : Firstname2 lastname3 Address: 333, station straat City: Amsterdam I need... (6 Replies)
Discussion started by: McLan
6 Replies

3. UNIX for Dummies Questions & Answers

report generation

Hello, I got a requirement in writing a sheel script in unix, please help me out the requirement is there are two folders Folder1 and Folder2 and there are same files in the different folders. like file1,file2 in folder1 and file1 and file2 in folder2. I would like to compare all the... (2 Replies)
Discussion started by: gmahesh2k
2 Replies

4. Shell Programming and Scripting

Report generation

Hello, I got a requirement in writing a KSH script in unix, please help me out the requirement is there are two folders Folder1 and Folder2 and there are same files in the different folders. like file1,file2 in folder1 and file1 and file2 in folder2. I would like to compare all the similar... (3 Replies)
Discussion started by: gmahesh2k
3 Replies

5. Shell Programming and Scripting

Disk report generation problem

Hello everyone, I have a list of inputs as below. My logic is to get the particular powerdisk which matches for ASM disk which means take the major & minor number of each asm disk and matches with powerdisk info then get the particular powerdisk $ ls -l /dev/asm_* ---> ASM disk info... (11 Replies)
Discussion started by: kannan84
11 Replies

6. Shell Programming and Scripting

File Report Generation

hi all i need to generate a report file that contains the following details of files present in a directory. 1. File name 2.Complete path for each files and directory 3.File size 4.Days older example i have a directory testing that contains sub-directories and some files. i need to make a... (5 Replies)
Discussion started by: yashwantkumar
5 Replies

7. Shell Programming and Scripting

Report generation based on certain conditions

Hi I recently joined a project where I have been asked to generate a report using shell script accessing UNIX box. I have no idea on how to do it as I am a beginner and learning shell scripts. Suppose I have a XML: Code: ... (3 Replies)
Discussion started by: vat1kor
3 Replies

8. Shell Programming and Scripting

Report generation using perl script

Hi, I have a perl script to read the log file and create a report from it. I have the script file and log file in a different directories. Now i have pipe the log file data to the perl script to create the report (HMTL file). I am using the below command this isn't working tail -f... (4 Replies)
Discussion started by: vel4ever
4 Replies

9. Shell Programming and Scripting

Using awk and grep for sql generation

Hi, I have a file pk.txt which has table related data in following format TableName | PK Employee | id Contact|name,phone,country I have another file desc.txt which lists datatype of each field like this: Table|Field|Type Employee|id|int Contact|name|string Contact|country|string... (7 Replies)
Discussion started by: wahi80
7 Replies

10. UNIX for Beginners Questions & Answers

Report generation using script

Hi all I have a unix script that generates a report with the following information: uptime, mounted file systems, disk usage (> 90% --> critical, <75%-90%> --> warning, < 75% healthy), Mem usage, CPU usage and load average. But I would like to create one single report containing all this... (5 Replies)
Discussion started by: fretagi
5 Replies
KVKCARD(1)																KVKCARD(1)

NAME
kvkcard - a commandline tool to read information from a German medical card SYNOPSIS
kvkcard read | daemon | rdvd | rdpd [ [ -v | --verbous ] [ -fFILE | --filename=FILE ] [ -cCARDID | --cardid=CARDID ] [ -b | --beep ] [ -d | --dosmode ] [ -pPROGRAM | --program=PROGRAM ] [ -aARGUMENTS | --args=ARGUMENTS ] [ -h | --help ] ] DESCRIPTION
kvkcard is a commandline tool to read information from a German medical card (KVK or eGK). ARGUMENTS
read Read data from a German medical card. daemon Wait for insertion of a German medical card and run a program on it. rdvd Dump RDVD data structure of a card. rdpd Dump RDPD data structure of a card. -v | --verbous Every occurrence of this option increases the verbosity. -f FILE | --filename=FILE File to write to. If omitted stdout will be used. -c CARDID | --cardid=CARDID Set the ID of the card to read. -b | --beep Beep after reading a card. -d | --dosmode Output data in DOS mode. -p PROGRAM | --program=PROGRAM Program to call on cards found. -a ARGUMENTS | --args=ARGUMENTS Arguments for the program to be called -h | --help Shows this help. FILES
/etc/chipcard/ The system-wide configuration files. /var/log/chipcard/ The default log files. SEE ALSO
http://www.libchipcard.de Homepage of libchipcard project. /usr/share/doc/libchipcard-tools/ Local documentation. REVISION
Manual for kvkcard 2009 March 19th KVKCARD(1)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy