Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Faster way to multiply a file Nth times? Post 302544766 by itkamaraj on Friday 5th of August 2011 12:53:07 AM
Old 08-05-2011
Yazu, solution is best

try that.. let us know if you dont have perl
These 2 Users Gave Thanks to itkamaraj For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Which is faster? Reading from file or 'ps'

Hi There... I have an application which starts up many different processes under different names and I'm creating a script to tell me which processes are running (approx 30 different processes). To do this, I parse the results of a ps -u $USER. My question is, will my script be faster if I run... (2 Replies)
Discussion started by: orno
2 Replies

2. Shell Programming and Scripting

Script to parse a file faster

My example file is as given below: conn=1 uid=oracle conn=2 uid=db2 conn=3 uid=oracle conn=4 uid=hash conn=5 uid=skher conn=6 uid=oracle conn=7 uid=mpalkar conn=8 uid=anarke conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5 conn=2 op=-1 msgId=-1 -... (7 Replies)
Discussion started by: sags007_99
7 Replies

3. HP-UX

Faster command for file copy than cp ?

we have 30 GB files on our filesystem which we need to copy daily to 25 location on the same machine (but different filesystem). cp is taking 20 min to do the copy and we have 5 different thread doing the copy. so in all its taking around 2 hr and we need to reduce it. Is there any... (9 Replies)
Discussion started by: shipra_31
9 Replies

4. Shell Programming and Scripting

Using AWK to find top Nth values in Nth column

I have an awk script to find the maximum value of the 2nd column of a 2 column datafile, but I need to find the top 5 maximum values of the 2nd column. Here is the script that works for the maximum value. awk 'BEGIN { subjectmax=$1 ; max=0} $2 >= max {subjectmax=$1 ; max=$2} END {print... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

5. Shell Programming and Scripting

Calculating average for every Nth line in the Nth column

Is there an awk script that can easily perform the following operation? I have a data file that is in the format of 1944-12,5.6 1945-01,9.8 1945-02,6.7 1945-03,9.3 1945-04,5.9 1945-05,0.7 1945-06,0.0 1945-07,0.0 1945-08,0.0 1945-09,0.0 1945-10,0.2 1945-11,10.5 1945-12,22.3... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

6. Shell Programming and Scripting

Replace a value of Nth field of nth row

Using Awk, how can I achieve the following? I have set of record numbers, for which, I have to replace the nth field with some values, say spaces. Eg: Set of Records : 4,9,10,55,89,etc I have to change the 8th field of all the above set of records to spaces (10 spaces). Its a delimited... (1 Reply)
Discussion started by: deepakwins
1 Replies

7. UNIX for Dummies Questions & Answers

What is the faster way to grep from huge file?

Hi All, I am new to this forum and this is my first post. My requirement is like to optimize the time taken to grep the file with 40000 lines. There are two files FILEA(40000 lines) FILEB(40000 lines). The requirement is like this, both the file will be in the format below... (11 Replies)
Discussion started by: mad man
11 Replies

8. UNIX for Beginners Questions & Answers

Multiply values from a file

Hi All, I extracted a file using an awk command like this awk '{print substr($0,78,5)"," substr($0,59,6) "," substr($0,81,3) "," substr($0,11,7)}' file1 >> OUTPUT cat OUTPUT 00001,100000,005,0000080 00001,100000,008,0000220 00001,100000,001,0001000 00010,100000,001,0000400 I want... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
utc(1m) 																   utc(1m)

NAME
utc - A dcecp object that manipulates UTC timestamps SYNOPSIS
utc add timestamp relative_timestamp utc compare absolute_timestamp absolute_timestamp [-noinaccuracy] utc convert absolute_timestamp [-gmt] utc help [operation | -verbose] utc multiply relative_timestamp {integer | floating_point_factor} utc operations utc subtract timestamp timestamp ARGUMENTS
An International Organization for Standardization (ISO) compliant time format of the following form: CCYY-MMDD- hh:mm:ss.fff[+|-]hh:mmIsss.fff The Time Differential Factor (TDF) component [+|-]hh.mm, if present, indicates the offset from Universal Time Coordinated (UTC) time and implies local system time. The inaccuracy component Iss.fff, if present, specifies the duration of the time interval that contains the absolute time. A floating-point number such as 53.234. A whole number such as 79. The name of the utc operation for which to display help information. A Distributed Time Service (DTS) timestamp of the following form: [-]DD-hh:mm:ss.fff- Iss.fff Relative times often omit fractions of seconds (the leftmost .fff sequence) and generally lack an inaccuracy component (Iss.fff). For example, a relative time of 21 days, 8 hours, and 15 minutes is expressed as 21-08:15:00. A utc timestamp that can be a relative or absolute time. See the relative_timestamp and absolute_timestamp argument descriptions for the format of these timestamps. DESCRIPTION
The utc object lets you add, compare, and convert timestamps in DTS and ISO formats. OPERATIONS
utc add Adds two timestamps. The syntax is as follows: utc add timestamp relative_timestamp The add operation returns the sum of two timestamps. The timestamps can be two relative times or an absolute time and a relative time. Privileges Required No special privileges are needed to use the utc add command. Examples dcecp> utc add 1994-10-18-13:21:50.419-04:00I----- +0-00:02:00.000I----- 1994-10-18-13:23:50.419-04:00I----- dcecp> utc compare Compares two absolute timestamps indicating the temporal order. The syntax is as follows: utc compare absolute_timestamp absolute_time- stamp [-noinaccuracy] The compare operation compares two timestamps and returns -1 if the first is earlier, 1 if the second is earlier, and 0 if the difference is indeterminate. Specify the -noinaccuracy option to ignore inaccuracies in comparisons; in this case a return of 0 indicates the times are the same. Privileges Required No special privileges are needed to use the utc compare command. Examples dcecp> utc compare 1994-10-18-13:22:32.816-04:00I----- > 1994-10-18-13:21:50.419-04:00I----- -noinaccuracy 1 dcecp> utc convert Converts a timestamp from UTC to local time. The syntax is as follows: utc convert absolute_timestamp [-gmt] The convert operation accepts a timestamp and returns another timestamp that expresses the same time in the local time zone. If called with the -gmt option it returns a Greenwich mean time (GMT) formatted timestamp. Privileges Required No special privileges are needed to use the utc convert command. Examples dcecp> utc convert 1994-10-18-13:22:32.816-00:00I----- 1994-10-18-09:22:32.816-04:00I----- dcecp> dcecp> utc convert 1994-10-18-13:22:32.816-00:00I----- -gmt 1994-10-18-13:22:32.816I----- dcecp> utc help Returns help information about the utc object and its operations. The syntax is as follows: utc help [operation | -verbose] Options Displays information about the utc object. Used without an argument or option, the utc help command returns brief information about each utc operation. The optional operation argu- ment is the name of an operation about which you want detailed information. Alternatively, you can use the -verbose option for more detailed information about the utc object itself. Privileges Required No special privileges are needed to use the utc help command. Examples dcecp> utc help add Adds a relative and absolute, or two relative, timestamps. compare Compares two timestamps to determine which is earlier. convert Converts a timestamp into the local timezone or GMT. multiply Multiplies a relative timestamp by a number. subtract Returns the difference between two timestamps. help Prints a summary of command-line options. operations Returns a list of the valid operations for this command. dcecp> utc multiply Multiplies a relative time (a length of time) by an integer or floating-point factor. The syntax is as follows: utc multiply rela- tive_timestamp {integer | floating_point_factor} The multiply operation accepts two arguments: a relative timestamp and an integer or floating-point factor. It multiplies the length of time (specified by the relative timestamp) by the integer or floating-point factor, returning the product as a relative timestamp. Privileges Required No special privileges are needed to use the utc multiply command. Examples dcecp> utc multiply +0-00:00:05.000I----- 3 +0-00:00:15.000I----- dcecp> utc operations Returns a list of the operations supported by the utc object. The syntax is as follows: utc operations The list of available operations is in alphabetical order except for help and operations, which are listed last. Privileges Required No special privileges are needed to use the utc operations command. Examples dcecp> utc operations add compare convert multiply subtract help operations dcecp> utc subtract Subtracts one timestamp from another, returning the difference as a relative timestamp. The syntax is as follows: utc subtract timestamp timestamp The subtract operation returns the difference between two timestamps that express either an absolute time and a relative time, two relative times, or two absolute times. Subtracting an absolute timestamp from a relative timestamp, however, is not allowed. The return value is an absolute or relative timestamp, depending on how the command is used. Privileges Required No special privileges are needed to use the utc subtract command. Examples dcecp> utc subtract 1994-10-18-13:22:32.816-00:00I----- +0-00:00:15.000I----- 1994-10-18-13:22:17.816+00:00I----- dcecp> RELATED INFORMATION
Commands: dcecp(1m), dcecp_clock(1m), dcecp_dts(1m), dtsd(1m). utc(1m)
All times are GMT -4. The time now is 11:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy