I have a file say test.txt, data in that file is in format such that 1st column represents number of executions of particular function
2nd column represents total amount of time
3rd column represents function name
I want to get the poor/slow performing function from this file.
So, ideally what need to do is...
(1) divide the 2nd column by 1st column
(make sure there is no divide by ZERO error)
(2) sort the output in such a way that the record with greater output of step(1) is at top
(3) depending on this sorting display the result file.
result should not contain the division but should contain the original value.
example...
inputfile...
-------------<end of file>------------------------
here... after division we see these are greater...
253/721 = 0.35090152
260/873 = 0.29782359
so output should look like...
721 (253 sec, 632655866 nanosec) efgh
873 (260 sec, 715043557 nanosec) lppeuv
.
.
Last edited by Yogesh Sawant; 06-28-2009 at 05:03 AM..
Reason: added code tags
Hi,
i am pretty new to Unix environment .....
Can i get some help from any of you guyz on writing Unix script.
my requirement is like reading a csv file, finding a specific pattern in the lines and repalce the string with new string and write it to another file.
My file is file ABC123.dat... (3 Replies)
Hi Guru's,
I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files.
For example, In the given directory these files... (3 Replies)
I have some complication with this, I have a file like below for DEV_1 till DEV_10. and the db values are set accordinly which are not unique. For example DEV1,DEV4,DEV6 can have the same target DB name.
I waned to identify for DEV_2 and then replace the TARGET_DATABASE value with the new DB... (6 Replies)
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Hi,
I am writing a shell script to parse some files, and gather data.
The data in the files is displayed as below.
.......xyz: abz: ......qrt: ....
.......xyz: abz: ......qrt: ...
I have tried using awk and cut, but the position of these values keep changing, so I wasn't able to get... (2 Replies)
Hi ! All
I just want to search and write to new file if pattern is found in text file
following are my text files by which I want to search Month and last column number
my text file1
15-Jan-2011 25 ARTS 1255 125 125 178 198
15-Jan-2011 25 ARTS 1255 125 125 178 198
15-Jan-2011 25... (3 Replies)
I need to parse a file and depending on a patern match(in the insert job line) separate files have to be created with a line added (content in file2).
Mapping for pattern match and add line :
for Alpha 123
for Beta 234
for Gamma 345
no match (goes into another file)
File 1 ... (3 Replies)
Hi,
I have a file which contains the below details.. My requirement is to fetch all the lines which are starting with "ABC_XY_" into 1 file and rest of the lines (not starting with "ABC_XY_") into another file.
Could you please help with what command needs to be used?
file1.txt
----------... (12 Replies)
the following pattern match works correctly for me
awk '/name="Fruits"/{f=1;next} /"name=Vegetables"/{f=0} f' filename
This works well for me. Id like to temporarily move the match out of the file ( > newfile) and be able to stick it back in the same place at a later time.
Is this... (7 Replies)
Discussion started by: TY718
7 Replies
LEARN ABOUT FREEBSD
archive_entry_atime_nsec
ARCHIVE_ENTRY_TIME(3) BSD Library Functions Manual ARCHIVE_ENTRY_TIME(3)NAME
archive_entry_atime, archive_entry_atime_nsec, archive_entry_atime_is_set, archive_entry_set_atime, archive_entry_unset_atime,
archive_entry_birthtime, archive_entry_birthtime_nsec, archive_entry_birthtime_is_set, archive_entry_set_birthtime,
archive_entry_unset_birthtime, archive_entry_ctime, archive_entry_ctime_nsec, archive_entry_ctime_is_set, archive_entry_set_ctime,
archive_entry_unset_ctime, archive_entry_mtime, archive_entry_mtime_nsec, archive_entry_mtime_is_set, archive_entry_set_mtime,
archive_entry_unset_mtime, -- functions for manipulating times in archive entry descriptions
LIBRARY
Streaming Archive Library (libarchive, -larchive)
SYNOPSIS
#include <archive_entry.h>
time_t
archive_entry_atime(struct archive_entry *a);
long
archive_entry_atime_nsec(struct archive_entry *a);
int
archive_entry_atime_is_set(struct archive_entry *a);
void
archive_entry_set_atime(struct archive_entry *a, time_t sec, long nanosec);
void
archive_entry_unset_atime(struct archive_entry *a);
time_t
archive_entry_birthtime(struct archive_entry *a);
long
archive_entry_birthtime_nsec(struct archive_entry *a);
int
archive_entry_birthtime_is_set(struct archive_entry *a);
void
archive_entry_set_birthtime(struct archive_entry *a, time_t sec, long nanosec);
void
archive_entry_unset_birthtime(struct archive_entry *a);
time_t
archive_entry_ctime(struct archive_entry *a);
long
archive_entry_ctime_nsec(struct archive_entry *a);
int
archive_entry_ctime_is_set(struct archive_entry *a);
void
archive_entry_set_ctime(struct archive_entry *a, time_t sec, long nanosec);
void
archive_entry_unset_ctime(struct archive_entry *a);
time_t
archive_entry_mtime(struct archive_entry *a);
long
archive_entry_mtime_nsec(struct archive_entry *a);
int
archive_entry_mtime_is_set(struct archive_entry *a);
void
archive_entry_set_mtime(struct archive_entry *a, time_t sec, long nanosec);
void
archive_entry_unset_mtime(struct archive_entry *a);
DESCRIPTION
These functions create and manipulate the time fields in an archive_entry. Supported time fields are atime (access time), birthtime (cre-
ation time), ctime (last time an inode property was changed) and mtime (modification time).
libarchive(3) provides a high-resolution interface. The timestamps are truncated automatically depending on the archive format (for archiv-
ing) or the filesystem capabilities (for restoring).
All timestamp fields are optional. The XXX_unset() functions can be used to mark the corresponding field as missing. The current state can
be queried using XXX_is_set(). Unset time fields have a second and nanosecond field of 0.
SEE ALSO archive(3), archive_entry(3)HISTORY
The libarchive library first appeared in FreeBSD 5.3.
AUTHORS
The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
BSD February 2, 2012 BSD