Sponsored Content
Top Forums Shell Programming and Scripting Awk getting statistics of a grid file, Post 302527048 by alex2005 on Thursday 2nd of June 2011 07:33:13 AM
Old 06-02-2011
Hello,
Please find bellow the formula that will give us the grid values:
Code:
$ awk '{print $0, int(($2+7)/8)-int(1100/8)}' grid.test | more
5001                1001 -11
5001                1002 -11
5001                1003 -11
5001                1004 -11
5001                1005 -11
5001                1006 -11
5001                1007 -11
5001                1008 -11
5001                1009 -10
5001                1010 -10
5001                1011 -10
5001                1012 -10
5001                1013 -10
5001                1014 -10
5001                1015 -10
5001                1016 -10
5001                1017 -9
5001                1018 -9
5001                1019 -9
5001                1020 -9
5001                1021 -9
5001                1022 -9
 
------------------------
5001                1076 -2
5001                1077 -2
5001                1078 -2
5001                1079 -2
5001                1080 -2
5001                1081 -1
5001                1082 -1
5001                1083 -1
5001                1084 -1
5001                1085 -1
5001                1086 -1
5001                1087 -1
5001                1088 -1
5001                1089 0
5001                1090 0
5001                1091 0
5001                1092 0
5001                1093 0
5001                1094 0
5001                1095 0
5001                1096 0
5001                1097 1
5001                1098 1
5001                1099 1
5001                1100 1
5001                1101 1
5001                1102 1
5001                1103 1
5001                1104 1
5001                1105 2
5001                1106 2
5001                1107 2
5001                1108 2
5001                1109 2
5001                1110 2
5001                1111 2
5001                1112 2
5001                1113 3
5001                1114 3
5001                1115 3
5001                1116 3
5001                1117 3
5001                1118 3
5001                1119 3
5001                1120 3
5001                1121 4
5001                1122 4
5001                1123 4
5001                1124 4
5001                1125 4

1100 will define the grid origin (if you'll put 1001 than 1001 will be the grid origin).
Thanks

Last edited by Franklin52; 06-02-2011 at 10:35 AM.. Reason: Please use code tags for code and data examples
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create a grid file

Hi everybody: I want to create a grid file for export to statistical program. My aid is create a file with both rows, one row are x coordenates and other for y coordenates. All grid obviousolly are same space. the form that i want is this: x=(400000 ........ 600000) and y=(4000000 .......... (1 Reply)
Discussion started by: tonet
1 Replies

2. UNIX for Dummies Questions & Answers

file statistics??

Is there any command in Unix (HP-UX) which will give me the file statistics .. e.g I have a file called r001 if I created that file on 2nd of aug 2005 and till now I changed that file contents 10 times. So how will I get the history statistic(time & date) of file modification. (1 Reply)
Discussion started by: zing_foru
1 Replies

3. Shell Programming and Scripting

AWK- extracting values from columns, saving them and gettins statistics

Hello, I am obviously quite new to unix and awk. I need to parse certain columns of a file (delimited by spaces), and somehow save the value of this column somewhere, together with the value of the column just after it (by pairs; so something like ). I'm then supposed to count the times that... (9 Replies)
Discussion started by: acsg
9 Replies

4. Shell Programming and Scripting

statistics using awk

Hi, I have 3 columns in a file listed below. X Y X/(X+Y) 1 1 0.5 1 1 0.5 4 1 0.8 1 1 0.5 6 1 0.857142857 1 1 0.5 23 1 0.958333333 Now I want to find confidence interval using the formula for each row. (p-2 sqrt p(1-p)/(x+y), p+2... (7 Replies)
Discussion started by: Diya123
7 Replies

5. Programming

C++ Help with file handle and simple statistics problem asking...

Input_file: >header_1 ASDFFDASADASF >header_2 ASDSAFASDAAFFFAFA Desired output file: 30 Source Code try: // reading a text file #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("Input_file"); (3 Replies)
Discussion started by: perl_beginner
3 Replies

6. Shell Programming and Scripting

Writing only timing statistics output of Timer to File

I'm running long integrations on a remote server, and I'm working in terminal in a tcsh shell. I'm looking to write ONLY the timing statistics to a file. For example: $time ls >timer.out writes both the files in my current directory & the timer statistics to the file timer.out. I only... (2 Replies)
Discussion started by: elemonier
2 Replies

7. Shell Programming and Scripting

awk based script to print the "mode(statistics term)" for each column in a data file

Hi All, Thanks all for the continued support so far. Today, I need to find the most occurring string/number(also called mode in statistics terminology) for each column in a data file (.csv type). For one column of data(1.txt) like below Sample 1 2 2 3 4 1 1 1 2 I can find the mode... (6 Replies)
Discussion started by: ks_reddy
6 Replies

8. Red Hat

CPU Usage statistics Dump in a text file over a period of time

I am facing issue related to performance of one customized application running on RHEL 5.9. The application stalls for some unknown reason that I need to track. For that I require some tool or shell scripts that can monitor the CPU usage statistics (what we get in TOP or in more detail by other... (6 Replies)
Discussion started by: Anjan Ganguly
6 Replies

9. UNIX for Advanced & Expert Users

Need optimized awk/perl/shell to give the statistics for the Large delimited file

I have a file size is around 24 G with 14 columns, delimiter with "|" My requirement- can anyone provide me the fastest and best to get the below results Number of records of the file First column and second Column- Unique counts Thanks for your time Karti ------ Post updated at... (3 Replies)
Discussion started by: kartikirans
3 Replies
GRID-MAPFILE-CHECK(8)						  Globus Commands					     GRID-MAPFILE-CHECK(8)

NAME
grid-mapfile-check-consistency - Add an entry to a grid map file SYNOPSIS
grid-mapfile-check-consistency [-h] [-help] [-usage] [-version] grid-mapfile-check-consistency [-mapfile MAPFILE] | [-f MAPFILE] DESCRIPTION
The grid-mapfile-check-consistency program performs basic checks for validity of a gridmap file. These checks include checks for existence, duplication of entries, and valid local user names. If the gridmap file is valid, grid-mapfile-check-consistency exits with a zero exit code, otherwise it exits with a non-zero exit code. In either case, it displays information about its progress as it parses and validates the gridmap file. By default, grid-mapfile-check-consistency will check the gridmap file named by the GRIDMAP environment variable if present. If that variable is not set, it will check the file $HOME/.gridmap for non-root users if present. If that doesn't exist or grid-mapfile-check-consistency is run as root, it will then check /etc/grid-security/grid-mapfile. This can be changed by the use of the -mapfile or -f command-line options. The full set of command-line options to grid-mapfile-check-consistency are: -help, -h, -usage Display the command-line options to grid-mapfile-check-consistency. -version Display the version number of the grid-mapfile-check-consistency command. -mapfile MAPFILE, -f MAPFILE Check the gridmap file named by MAPFILE instead of the default. EXAMPLES
Check that the gridmap file in /etc/grid-security is valid: % grid-mapfile-check-consistency -f /etc/grid-security/grid-mapfile Checking /etc/grid-security/grid-mapfile Verifying grid mapfile existence...OK Checking for duplicate entries...OK Checking for valid user names...OK Check a gridmap file that has an invalid local user name: % grid-mapfile-check-consistency -f /etc/grid-security/grid-mapfile Checking /etc/grid-security/grid-mapfile Verifying grid mapfile existence...OK Checking for duplicate entries...OK ERROR: baduser is not a valid local username ERROR: Found 1 invalid username(s) ENVIRONMENT VARIABLES
The following environment variables affect the execution of grid-mapfile-check-consistency: GRIDMAP Path to the default gridmap to check. FILES
The following files affect the execution of grid-mapfile-check-consistency: $HOME/.gridmap Path to the default gridmap to check if the GRIDMAP environment variable is not set for non-root users. /etc/grid-security/grid-mapfile Path to the default gridmap to check if GRIDMAP environment variable is not set and the above file does not exist. SEE ALSO
grid-mapfile-add-entry(8), grid-mapfile-delete-entry(8) AUTHOR
University of Chicago Globus Toolkit 5.0.1 03/19/2010 GRID-MAPFILE-CHECK(8)
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy