![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| recoding data points using SED?? | doobedoo | Shell Programming and Scripting | 7 | 10-12-2009 02:34 PM |
| need help with recode command for CR/LF | 2reperry | SuSE | 1 | 06-16-2009 03:33 PM |
| to extarct data points | cdfd123 | Shell Programming and Scripting | 5 | 01-12-2008 09:39 AM |
| Gnuplot question: how to plot 3D points as colored points in map view? | karman | UNIX and Linux Applications | 0 | 09-24-2007 07:03 AM |
| Writing both 8-bit and 16-bit data to a file | Breen | High Level Programming | 1 | 03-03-2004 01:59 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Writing an algorithm to recode data points
I have a file that has been partially recoded so that data points that were formerly letter combinations are now -1, 0, or 1. I need to finish recoding the GG and CC data points. The file looks like this:
ID 1 2 3 4 5 6 7 8 83845676 0 0 0 0 CC -1 CC CC 838469. -1 -1 1 GG CC 0 CC 1 83847041 -1 . 0 0 . 0 0 0 83847.4 0 -1 1 1 CC 0 0 0 83847085 0 CC 0 0 0 0 0 0 83847118 . -1 1 GG . GG CC 0 83847162 GG -1 1 0 0 0 0 0 83847165 -1 -1 . GG CC 0 GG 0 The problem with the GG and CC is that in either case they can be a -1 or a 1, depending on what has already been recoded. If a GG is in a column that already contains 1's then GG must = -1. If the GG is in a column that already contains -1's, then the GG must be a 1. This is also true for the CC columns. I have a total of >64,000 columns so I can not go through and list which column is which. It has been suggested that I need to write an algorithm to do this but I am not very familiar with programming. Can anyone help me? Thanks! Last edited by Franklin52; 4 Weeks Ago at 03:42 AM.. Reason: IMG tag process.gif removed |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|