Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need to filter data from a file Post 302538426 by erora on Wednesday 13th of July 2011 02:14:53 AM
Old 07-13-2011
Need to filter data from a file

Hi,
I have a file with hundreds of records.
There are four fields on each line, separated by semicolons.
Name
Height (meters)
Country
Continent (Africa,Asia,Europe,North America,Oceania,South
America,The Poles)

I need to Write the command to find display how many mountains appear in
the list on each continent , like this:
30 Africa
144 Asia
91 Europe
163 North America
11 Oceania
116 South America
3 The Poles

I know I can count it by using Grep and filters but I will need one command per continent. How do I use a single command to list down the output in this format?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

filter data

Hi I have two files and their names are donotcall.txt, filter_it.txt. I want output.txt file with all data that is in filter_it.txt file but not in donotcall.txt. Can anybody help me to write 1-2 lines unix code for this. donotcall.txt contains following data. Each row represent phone... (3 Replies)
Discussion started by: deep.singh
3 Replies

2. Windows & DOS: Issues & Discussions

Filter data from text file

Hi All We have got a text file, which has data dumped from 60 tables. From these 60 tables of data we need data from 4 tables only. I tried assigning line numbers to filter out data, but it is not working as intended. below is the sample file ----Table1----- 3,dfs,43,df 4,sd,5,edd... (18 Replies)
Discussion started by: b_sri
18 Replies

3. UNIX for Dummies Questions & Answers

Using input file to filter data from another file

I have a data file: abc Text Text Text Unique Text 123 Text word Line Unique Text fgh Text data Line Unique Text 789 Text Text Line Unique Text 543 Text Text Data Unique Text and a filter file 123 789 I want to extract out from the data file the two records that contain the keys... (1 Reply)
Discussion started by: tumblez
1 Replies

4. Shell Programming and Scripting

extract data from a data matrix with filter criteria

Here is what old matrix look like, IDs X1 X2 Y1 Y2 10914061 -0.364613333 -0.362922333 0.001691 -0.450094667 10855062 0.845956333 0.860396667 0.014440333 1.483899333... (7 Replies)
Discussion started by: ssshen
7 Replies

5. Shell Programming and Scripting

Shell script to read lines in a text file and filter user data

hi all, I have this file with some user data. example: $cat myfile.txt FName|LName|Gender|Company|Branch|Bday|Salary|Age aaaa|bbbb|male|cccc|dddd|19900814|15000|20| eeee|asdg|male|gggg|ksgu|19911216||| aara|bdbm|male|kkkk|acke|19931018||23| asad|kfjg|male|kkkc|gkgg|19921213|14000|24|... (4 Replies)
Discussion started by: srimal
4 Replies

6. UNIX for Advanced & Expert Users

filter last 24 hour data and put in new file

i have file server 1 (filesvr01acess.log) and disc server 1 (discsvr01acess.log) in unix box(say ip adress of the box 10.39.66.81) Similiarly i have file server 2 (filesvr01acess.log) and disc server 2(discsvr01acess.log) in another unix box(say ip adress of the box 10.39.66.82). Now my... (1 Reply)
Discussion started by: nripa1
1 Replies

7. Shell Programming and Scripting

How to filter required data from file using bash script?

Hi All , I have one file like below , Owner name = abu2-kxy-m29.hegen.app Item_id = AX1981, special_id = *NULL*, version = 1 Created = 09/01/2010 12:56:56 (1283389016) Enddate = 03/31/2011 00:00:00 (1301554800) From the above file I need to get the output in the below format ,i need... (3 Replies)
Discussion started by: gnanasekar_beem
3 Replies

8. Shell Programming and Scripting

Filter a .kml file (xml) with data set from text file

I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file 11951 11952 74014 11964 11965 11969 11970 11971 11972 60149 74018 74023 86378 11976 11980 11983 11984 11987 (5 Replies)
Discussion started by: pcoj33
5 Replies

9. Shell Programming and Scripting

How to filter out data file...?

Hi... I would like to filter out my data file....in two different way 1st way is like this, I will take one example..here... The script should ask like this. Enter min value in first column Enter max value in first column Enter min value in second column Enter max value in... (5 Replies)
Discussion started by: nex_asp
5 Replies

10. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies
NAD2NAD(1)                                                    General Commands Manual                                                   NAD2NAD(1)

NAME
nad2nad - North American Datum conversion filter SYNOPSIS
nad2nad [ -eEfihortwW [ args ] ] [ +args ] file[s] DESCRIPTION
Program nad2nad is a filter to convert data between North America Datum 1927 (NAD27) and North American Datum 1983. nad2nad can optionally process both State Plane Coordinate System (SPCS) and Universal Transverse Mercator (UTM) grid data as well as geographic data for both input and output. This can also be accomplished with the cs2cs program. The following control parameters can appear in any order: -[i|o] keyword[,keyword] The -i and -o option expect keyword arguments which define various characteristics and processing modes of the respective input data. Usage allows multiple arguments to be included with a - operator when separated by commas. Datum conversion requires the data to be in geographic coordinates, but nad2nad will allow conversion of data to and from SPCS or UTM grid systems. The following are keywords and arguments recognized by both the -i and -o that will apply to respective input and output conversion of user data to internal geographic coordinates: 27|83 datum of data utm=n UTM coordinates in meters for zone n spcs=n for data in SPCS coordinates, where n is state zone number. feet data units are in U.S. Surveyor's feet. This is allowed only when the spcs option been previously used. Default coordi- nates are in meters. bin for data in binary form. rev data in lat-lon order rather than default lon-lat order. hp=ss use high precision conversion zone ss. Certain States have ancillary correction tables to further refine the basic conus table. Ss key and States are: FL Florida MD Maryland TN Tennessee WI Wisconsin WO Washington, Oregon and northern part of California. -ta A specifies a character employed as the first character to denote a control line to be passed through without processing. This option applicable to ascii input only. (# is the default value). -e string String is an arbitrary string to be output if an error is detected during data transformations. The default value is: * *. Note that if the -o bin option is employed, an error is output as HUGE_VAL for both values. -r region specifies which regional conversion table to employ which are identified by the following: conus - conterminous 48 States alaska - State of Alaska hawaii - State of Hawaii prvi - Puerto Rico and Virgin Islands stgeorge - St. George Is, Alaska stpaul - St. Paul Is, Alaska stlrnc - St. Lawrence Is, Alaska -E Input coordinates are echoed to output before ouput values. -f format Format is a printf format string to control the form of the output values. For inverse projections, the output will be in degrees when this option is employed. If a format is specified for inverse projection the output data will be in decimal degrees. The default format is %.2f for forward projection and DMS for inverse. -[w|W]n N is the number of significant fractional digits to employ for seconds output (when the option is not specified, -w3 is assumed). When -W is employed the fields will be constant width and with leading zeroes. One or more files (processed in left to right order) specify the source of data to be transformed. A - will specify the location of pro- cessing standard input. If no files are specified, the input is assumed to be from stdin. For ASCII input data the two data values must be in the first two white space separated fields and when both input and output are ASCII all trailing portions of the input line are appended to the output line. Input geographic data (longitude and latitude) must be in DMS format when neither utm nor spcs is specified, otherwise in meters or feet (feet option used). Input data fields must be separated by white space and not have imbedded white space. Output data will be in tab separated fields of DMS or grid coordinates in meters or feet. Any data after the two input values are echoed after the two output data values. SEE ALSO
cs2cs(1U), proj(1U), Cartographic Projection Procedures for the UNIX Environment--A User's Manual, (Evenden, 1990, Open-file report 90-284). HOME PAGE
http://www.remotesensing.org/proj 2000/03/21 Rel. 4.4 NAD2NAD(1)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy