Sponsored Content
Top Forums Shell Programming and Scripting help with grep command or other useful command Post 302158753 by amm on Wednesday 16th of January 2008 07:20:06 AM
Old 01-16-2008
Hi Vino

Thanks a lot for your help and quick reply.
you have solved for me the first problem I have with the file name.
Thanks again. It's work..!! Great..!!

Regarding the second problem that I have, I think you get confused when I post the header, which is not the normal case. I have post the header to show you an Idea of my data type. That's all.

So, what I want exactly is, to convert the Lat and Long column in my output file to the new decimal coordinates system.

The output file for allpun.out:
960109 914 4.54 25- 9.21 40-50.34 14.83 2.81 12 335116.5 0.26 6.8 81.7 D1

940129 559 37.02 24-28.93 39-51.79 0.86 1.99 17 151 9.0 0.07 0.2 0.4 B1

940130 1047 38.93 24-53.89 40-44.31 9.52 2.89 20 321 93.9 0.17 1.6 28.7 D1

940131 843 37.78 24-53.54 40-46.08 5.19 2.88 17 322 96.4 0.21 15.9 49.9 D1

So, the Coordinates in this file are in Degree, Minutes and Decimal Minutes.
for example, 25- 9.21, are in 25 degree, 9 minute and .21 decimal minutes.
What I want is, to convert from this forms to the forms of Degree and Decimal Degree.
For example, 25.1535 which is in degree and decimal degree by deviding the 9.21 by 60 and add the result to the degree.
For example, 9.21/60=0.1535, adding to the degree, 25+0.1535=25.1535.
The final coordinate system is 25.1535 , In degree and decimal degree. That's all.

And of course, I wanna do this operations and keeping all other data in its place.

This next step, from the output file ABOVE (after converting to new coordinate system), I wanna make a (Grep) selection for my interested range of my Lat and Long to the new output file. (the Minimum Lat and Maximum Lat and Mini. Long and Max. Long).
Like a square area!! with Lat and Long in each corner!
I'm just explaining the Idea..!!

Let's say I wanna make a range of selection from my data file above for a range of Long and Lat. For example, I wanna start from Minimum Latitude 24.30 to Maximum Latitude 25.80. And the same for the Longitude, I wanna start from Min. Long 39.20 to Max Long 40.50. That's all..!!


Hope this give more Idea about my case.

Thank you in advance,

amm
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep command

Hi, how to search all occurance of keyword in current directory files and sub folder's files also using grep command. thanks (2 Replies)
Discussion started by: avadhani
2 Replies

2. UNIX for Advanced & Expert Users

how to exclude the GREP command from GREP

I am doing "ps -f" to see my process. but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude # ps -f UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies

3. Shell Programming and Scripting

Help me on Grep Command

Hi, Can anybody explain me about the below mentioned code. grep "^" $FILENAME | cut -c 1-8,84- | awk '{ if (!($2+$3)) printf $1 "," }' >$TEMP_FILENAME Thanks in advance. (3 Replies)
Discussion started by: Kattoor
3 Replies

4. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

5. Shell Programming and Scripting

Grep Command

Hi, I Want to grep the 500th character of a line in a file. please help on this. Thanks in advance (7 Replies)
Discussion started by: raghulshekar
7 Replies

6. UNIX for Dummies Questions & Answers

grep command - help

I need to find the word "who" in a file but only that word. For instance I don't want it to find the word "whoever." Any suggestions? (2 Replies)
Discussion started by: brooksie91
2 Replies

7. Shell Programming and Scripting

Help with using grep command with copy command

Hi, im taking an entry Unix class, and as part of my lab assignment I have to copy all files in the /home/david/lab3 directory that have the file extension .save to your lab3/temp directory. I'm having trouble getting the grep to do anything worth while I've been trying to do: cp... (6 Replies)
Discussion started by: Critical jeff
6 Replies

8. Shell Programming and Scripting

help with grep command

i have a file which lists the following T2323 T3445 T67666,T6534,T4546 T7878 i need to extract the numeric part only(ie,without T). i tried this script awk '{print substr($0,2,length($0))}' pmt2.txtOutput 2323 3445 67666,T6534,T4546as u can see the numbers coming after "," remains the... (2 Replies)
Discussion started by: born
2 Replies

9. Shell Programming and Scripting

help with grep command

i have the following lines T2345 T3435 - bugfixed and running T5654 fixed and committed T34541:- fixed and committed i need to extract only the T part (eg:T2345) ,ie i dont want any special characters after it. i have been trying with grep and egrep but with no luck. pls help (11 Replies)
Discussion started by: born
11 Replies

10. Shell Programming and Scripting

Grep command giving different result for different users for same command

Hello, I am running below command as root user #nodetool cfstats tests | grep "Memtable switch count" Memtable switch count: 12 Where as when I try to run same command as another user it gives different result. #su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies
COLORGCCRC(5)							File Formats Manual						     COLORGCCRC(5)

NAME
colorgccrc - configuration file for colorgcc DESCRIPTION
A colorgccrc configuration file is used to configure the highlighting of the compiler output from colorgcc. SYNTAX
Each line consists of a keyword designating a configuration variable. The keyword is followed by `:' and then one or several values (depending on the keyword). Lines beginning with a hash mark `#' are comments. CONFIGURATION VARIABLES
g++ | gcc | c++ | cc | g77 | gcj | gnat | gpc Specifies the paths to the compilers. Takes one value; a path to the compiler. nocolor Specifies what terminal types colorization should be disabled on. Takes one or several values, separated by whitespace. srcColor Specifies the highlighting attributes source-code should be given. Takes one or several color attributes. See the section COLOR ATTRIBUTES for more information. introColor Specifies the highlighting attributes for normal compiler output. Takes one or several color attributes. See the section COLOR ATTRIBUTES for more information. warningFileNameColor | errorFileNameColor Specifies the highlighting attributes for the filename in a warning or an error, respectively. Takes one or several color attributes. See the section COLOR ATTRIBUTES for more information. warningNumberColor | errorNumberColor Specifies the highlighting attributes for the line-number in a warning or an error, respectively. Takes one or several color attributes. See the section COLOR ATTRIBUTES for more information. warningMessageColor | errorMessageColor Specifies the highlighting attributes for the message-text in a warning or an error, respectively. Takes one or several color attributes. See the section COLOR ATTRIBUTES for more information. COLOR ATTRIBUTES
The following attributes are valid for highlighting. clear, reset bold, underline, underscore, blink, reverse, concealed black, red, green, yellow, blue, magenta, cyan, white on_black, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white SEE ALSO
gcc(1), colorgcc(1) HISTORY
Jan 15 2003: Initial version of this manual-page. REPORTING BUGS
Report bugs to <jmoyers@geeks.com> AUTHORS
Jamie Moyers <jmoyers@geeks.com> is the author of colorgcc. This manual page was written by Joe Wreschnig <piman@sacredchao.net>, and modified by David Weinehall <tao@debian.org>, for the Debian GNU/Linux system (but may be used by others). COPYRIGHT
Copyright (C) 2003 Jamie Moyers This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. Jan 15, 2003 COLORGCCRC(5)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy