But, I don't want the file name to be included in the output file?
(the file name start at the beginning of each line and followed by a colon ':', then the contents of each file).
How do I do that?
Second, how do I grep only, let's say, a range of Latitude and a range of Longitude from the final output file? (Above)
Then, I want to convert the Lat and Long columns to decimals numbers? without the '-' sign?
For your information, the header of this data files are:
DATE ORIGIN LAT N LONG E DEPTH MAG NO GAP DMIN RMS ERH ERZ QM
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
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..!!
I would like to thanks you all, who ever help the others...!!
First, I would like to thanks ennstate for his valuable coding he provide. With special thanks too, for ghostdog74, for making the coding more simpler looking..!! Thanks you all experts member's..!!
Second, I have tried the coding and I have succeeded for doing the (first part of my) job. With slight modification on it..!!
However, I have just add END statement before the PRINT command. And I saved the coding as a file, for example, as an abc.awk script file. That's all. ( I wrote this detail, to be useful for other to follow).
But, there are some problems..!!
The coding gave only the last line result..!! or only one result from this script..?? I will show the output from this coding later.
Also as END statement will be executed only once so it produces only the result of the last line in this case.But am not sure why it does print only the two fields as in your output.
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)
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)
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)
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)
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)
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)