Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Script for data editing
Ohana
post May 9 2009, 06:44 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 9-May 09
Member No.: 14,449



Hi All,
I need help with grepping specific lines in a data file and then saving them to a new file.
I would like to find and save any line in the data file that has two of the following strings in the first column:

P011 P028 RG09 RG10 RG11 RG12 RG13 P039

example -> 'P011_GPS-P028_GPS'

An example of the data:

P039_GPS-P040_GPS -0.30 0.64 0.10
P044_GPS-P040_GPS -0.10 -0.76 0.10
WHN1_GPS-P040_GPS 2.08 0.86 1.28
P038_GPS-P040_GPS -2.52 -2.18 0.92
TCUN_GPS-P040_GPS -0.31 -9.00 0.11
RG13_GPS-P040_GPS 1.35 2.98 0.11
P070_GPS-P040_GPS 0.49 0.08 0.13
RG24_GPS-P040_GPS -0.20 0.79 0.11
RG12_GPS-P040_GPS 0.01 1.58 0.11
RG08_GPS-P040_GPS -0.23 1.35 0.18
P037_GPS-P040_GPS -0.17 -0.34 0.09
RG03_GPS-P040_GPS 0.23 1.83 0.28
P035_GPS-P040_GPS -0.11 0.45 0.10
P041_GPS-P040_GPS -0.21 -0.47 0.10
RG23_GPS-P040_GPS -0.65 0.44 0.10
RG19_GPS-P040_GPS -0.48 -0.27 0.13
P120_GPS-P040_GPS -0.04 0.09 0.13
....

I've been trying to use a double for loop in bash to do it, but I haven't been able to figure it out.
Any help would be appreciated.
Thanks


Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
darkob
post May 6 2011, 12:11 PM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 3
Joined: 6-May 11
Member No.: 15,292



QUOTE (Ohana @ May 9 2009, 06:44 PM) *
Hi All,
I need help with grepping specific lines in a data file and then saving them to a new file.
I would like to find and save any line in the data file that has two of the following strings in the first column:

P011 P028 RG09 RG10 RG11 RG12 RG13 P039

example -> 'P011_GPS-P028_GPS'

An example of the data:

P039_GPS-P040_GPS -0.30 0.64 0.10
P044_GPS-P040_GPS -0.10 -0.76 0.10
WHN1_GPS-P040_GPS 2.08 0.86 1.28
P038_GPS-P040_GPS -2.52 -2.18 0.92
TCUN_GPS-P040_GPS -0.31 -9.00 0.11
RG13_GPS-P040_GPS 1.35 2.98 0.11
P070_GPS-P040_GPS 0.49 0.08 0.13
RG24_GPS-P040_GPS -0.20 0.79 0.11
RG12_GPS-P040_GPS 0.01 1.58 0.11
RG08_GPS-P040_GPS -0.23 1.35 0.18
P037_GPS-P040_GPS -0.17 -0.34 0.09
RG03_GPS-P040_GPS 0.23 1.83 0.28
P035_GPS-P040_GPS -0.11 0.45 0.10
P041_GPS-P040_GPS -0.21 -0.47 0.10
RG23_GPS-P040_GPS -0.65 0.44 0.10
RG19_GPS-P040_GPS -0.48 -0.27 0.13
P120_GPS-P040_GPS -0.04 0.09 0.13
....

I've been trying to use a double for loop in bash to do it, but I haven't been able to figure it out.
Any help would be appreciated.
Thanks

Go to the top of the page
 
+Quote Post

Posts in this topic
- Ohana   Script for data editing   May 9 2009, 06:44 PM
- - darkob   QUOTE (Ohana @ May 9 2009, 06:44 PM) Hi A...   May 6 2011, 12:11 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th December 2017 - 08:06 AM