Just to let people know what I have done, which to many will look very inefficient. This is why I am interested in knowing a quick solution to this. I first extracted the first column using the following command:
awk '{print $1}' input_file > output_file
Then separated the 1s and 0s in two separate files using the following command:
awk '{ print > $1 ".dat" }' input_file
Then added + before 1, and subtracted -1 from the file that contained 0. Then used cat to append the contents from the .dat files. Then used the paste command to paste the contents with the original file. This process is of course too time consuming. I am using Linux with BASH.
if( length($1) == 1 ) is not needed since 00 is 0 only, if he/she is treating 00 as char then length($1) would be necessary, and your old solution was right I think.