Sponsored Content
Full Discussion: AWK series of numbers
Top Forums Shell Programming and Scripting AWK series of numbers Post 302593103 by jacobs.smith on Wednesday 25th of January 2012 03:40:46 PM
Old 01-25-2012
Hi Corona,

Thanks a lot.

But I have more than 10000 rows and the one you gave me prints xyz_1, xyz_2 and xyz_3 repeatedly. I would like to have a series of numbers.

Thanks again.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to generate a series of numbers

Hi All, I have a requirement where in I have an input as follows:- input=1-4,6,8-10,12-15 I need to explode this range into an output file as follows:- 1 2 3 4 6 8 9 10 12 13 14 15 My input may vary like 1,5-9,11-13,15-17....... (3 Replies)
Discussion started by: rony_daniel
3 Replies

2. Shell Programming and Scripting

calculate the average of time series data using AWK

Hi, I have two time series data (below) merged into a file. t1 and t2 are in unit of second I want to calculate the average of V1 every second and count how many times "1" in V2 is occur within a second Input File: t1 V1 t2 V2 10.000000... (5 Replies)
Discussion started by: nica
5 Replies

3. Shell Programming and Scripting

How to sort out the latest one from a series of numbers?

Hi, I have a directory which contains a number of sub directories. They are named as 1.0.0, 1.0.1, 1.0.2...1.1.0..1.1.1...1.2.0..and so on.. Basically these are the tags created at the time of release. Tags are named as major.minor.buildnumber format for modules. Now I have to search the... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

4. Shell Programming and Scripting

How to code a series of numbers in SH

Hi. How can I write this in a shorter way? for NUMs in 1 2 3 4 5 6 I looked at the"seq" command, but I do not think that is what I want. Can I code for NUMs (1..7) Hey!! Is that it? (8 Replies)
Discussion started by: Ccccc
8 Replies

5. Homework & Coursework Questions

Help with shell script to find sum of first n numbers of Fibonacci series

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Shell script to find sum of first n numbers of Fibonacci series 2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: Kshitija
0 Replies

6. UNIX for Dummies Questions & Answers

To find missing numbers from a number series

Hi, My requirement is I have an input file with a continuous series from 10000 to 99999. I have some numbers missing from those series. I want a output file which produces those missing numbers. Eg: 10002, 99999 are missing from the series then the output file should contain those... (4 Replies)
Discussion started by: rakeshbharadwaj
4 Replies

7. Shell Programming and Scripting

awk - extracting data from a series of files

Hi, I am trying to extract data from multiple output files. I am able to extract the data from a single output file by using the following awk commands: awk '/ test-file*/{print;m=0}' out1.log > out1a.txt awk '/ test-string/{m=1;c=0}m&&++c==3{print $2 " " $3 " " $4 ;m=0}' out1.log >... (12 Replies)
Discussion started by: p_sun
12 Replies

8. Shell Programming and Scripting

Help with Using "while" loop to output series of numbers

Trying to use "while" loop command to create a series of numbers that looks like the following: 0 . 1 0 . 2 1 0 . 3 2 1 0 . 4 3 2 1 0 . 5 4 3 2 1 0 . 6 5 4 3 2 1 0 . 7 6 5 4 3 2 1 0 . 8 7 6 5 4 3 2 1 0 . 9 8 7 6 5 4 3 2 1 0 . I am very new to shell scripting and any help would be... (7 Replies)
Discussion started by: tarlz
7 Replies

9. Programming

Resample time series data with replacement any way to do this in awk or just bash script

I have some time series data that I need to resample or downsample at some specific time intervals. The firs column is time in decimal hours. I am tryiong to resample this data every 3 minutse. So I need a data value ever 0.05. Here is the example data and as you can see, there time slot for 0.1500... (3 Replies)
Discussion started by: malandisa
3 Replies

10. Shell Programming and Scripting

Moving decimal point in a series of numbers

Hi, i need to move the decimal point from a file listing some numbers like this : 49899.50 49914.55 49894.48 49939.65 49879.44 49919.57 49934.62 49944.67 49954.72 (1 Reply)
Discussion started by: Board27
1 Replies
EXPLAIN(7)							   SQL Commands 							EXPLAIN(7)

NAME
EXPLAIN - show the execution plan of a statement SYNOPSIS
EXPLAIN [ ANALYZE ] [ VERBOSE ] statement DESCRIPTION
This command displays the execution plan that the PostgreSQL planner generates for the supplied statement. The execution plan shows how the table(s) referenced by the statement will be scanned -- by plain sequential scan, index scan, etc. -- and if multiple tables are refer- enced, what join algorithms will be used to bring together the required rows from each input table. The most critical part of the display is the estimated statement execution cost, which is the planner's guess at how long it will take to run the statement (measured in units of disk page fetches). Actually two numbers are shown: the start-up time before the first row can be returned, and the total time to return all the rows. For most queries the total time is what matters, but in contexts such as a subquery in EXISTS, the planner will choose the smallest start-up time instead of the smallest total time (since the executor will stop after getting one row, anyway). Also, if you limit the number of rows to return with a LIMIT clause, the planner makes an appropriate interpolation between the endpoint costs to estimate which plan is really the cheapest. The ANALYZE option causes the statement to be actually executed, not only planned. The total elapsed time expended within each plan node (in milliseconds) and total number of rows it actually returned are added to the display. This is useful for seeing whether the planner's estimates are close to reality. Important: Keep in mind that the statement is actually executed when the ANALYZE option is used. Although EXPLAIN will discard any output that a SELECT would return, other side effects of the statement will happen as usual. If you wish to use EXPLAIN ANALYZE on an INSERT, UPDATE, DELETE, CREATE TABLE AS, or EXECUTE statement without letting the command affect your data, use this approach: BEGIN; EXPLAIN ANALYZE ...; ROLLBACK; PARAMETERS
ANALYZE Carry out the command and show the actual run times. VERBOSE Include the output column list for each node in the plan tree. statement Any SELECT, INSERT, UPDATE, DELETE, VALUES, EXECUTE, DECLARE, or CREATE TABLE AS statement, whose execution plan you wish to see. NOTES
There is only sparse documentation on the optimizer's use of cost information in PostgreSQL. Refer to in the documentation for more infor- mation. In order to allow the PostgreSQL query planner to make reasonably informed decisions when optimizing queries, the ANALYZE [analyze(7)] statement should be run to record statistics about the distribution of data within the table. If you have not done this (or if the statis- tical distribution of the data in the table has changed significantly since the last time ANALYZE was run), the estimated costs are unlikely to conform to the real properties of the query, and consequently an inferior query plan might be chosen. Genetic query optimization (GEQO) randomly tests execution plans. Therefore, when the number of join relations exceeds geqo_threshold caus- ing genetic query optimization to be used, the execution plan is likely to change each time the statement is executed. In order to measure the run-time cost of each node in the execution plan, the current implementation of EXPLAIN ANALYZE can add consider- able profiling overhead to query execution. As a result, running EXPLAIN ANALYZE on a query can sometimes take significantly longer than executing the query normally. The amount of overhead depends on the nature of the query. EXAMPLES
To show the plan for a simple query on a table with a single integer column and 10000 rows: EXPLAIN SELECT * FROM foo; QUERY PLAN --------------------------------------------------------- Seq Scan on foo (cost=0.00..155.00 rows=10000 width=4) (1 row) If there is an index and we use a query with an indexable WHERE condition, EXPLAIN might show a different plan: EXPLAIN SELECT * FROM foo WHERE i = 4; QUERY PLAN -------------------------------------------------------------- Index Scan using fi on foo (cost=0.00..5.98 rows=1 width=4) Index Cond: (i = 4) (2 rows) Here is an example of a query plan for a query using an aggregate function: EXPLAIN SELECT sum(i) FROM foo WHERE i < 10; QUERY PLAN --------------------------------------------------------------------- Aggregate (cost=23.93..23.93 rows=1 width=4) -> Index Scan using fi on foo (cost=0.00..23.92 rows=6 width=4) Index Cond: (i < 10) (3 rows) Here is an example of using EXPLAIN EXECUTE to display the execution plan for a prepared query: PREPARE query(int, int) AS SELECT sum(bar) FROM test WHERE id > $1 AND id < $2 GROUP BY foo; EXPLAIN ANALYZE EXECUTE query(100, 200); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=39.53..39.53 rows=1 width=8) (actual time=0.661..0.672 rows=7 loops=1) -> Index Scan using test_pkey on test (cost=0.00..32.97 rows=1311 width=8) (actual time=0.050..0.395 rows=99 loops=1) Index Cond: ((id > $1) AND (id < $2)) Total runtime: 0.851 ms (4 rows) Of course, the specific numbers shown here depend on the actual contents of the tables involved. Also note that the numbers, and even the selected query strategy, might vary between PostgreSQL releases due to planner improvements. In addition, the ANALYZE command uses random sampling to estimate data statistics; therefore, it is possible for cost estimates to change after a fresh run of ANALYZE, even if the actual distribution of data in the table has not changed. COMPATIBILITY
There is no EXPLAIN statement defined in the SQL standard. SEE ALSO
ANALYZE [analyze(7)] SQL - Language Statements 2010-05-14 EXPLAIN(7)
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy