'''
Created on June 5, 2012
Modified on June 26, 2012
@author: Dilum Bandara
@version: 0.1
@license: Apache License v2.0

   Copyright 2012 H. M. N. Dilum Bandara and Anura P. Jayasumana, Colorado State
   University

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
'''

'''
Extract multiple attributes
'''

fdIn = open('allMachines.txt', 'r')
fdOut = open('multipleAttributes.txt', 'w')

for line in fdIn:
    tmp = line[:-1].split('\t')
    if '-1' in tmp[2] or '-1' in tmp[3] or '-1' in tmp[4] or '-1' in tmp[5] or \
            '-1' in tmp[6] or '-1' in tmp[7] or '-1' in tmp[8] or '-1' in tmp[10]\
            or '-1' in tmp[11] or '-1' in tmp[12] or '-1' in tmp[13] or '-1' in tmp[14]:
        continue

    fdOut.write(tmp[0] + '\t' + tmp[1] + '\t' + tmp[2] + '\t' + tmp[3] + '\t' + tmp[4] \
        + '\t' + tmp[5] + '\t' + tmp[6] + '\t' + tmp[7] + '\t' + tmp[8] + '\t' + tmp[10]\
        + '\t' + tmp[11] + '\t' + tmp[12] + '\t' + tmp[13] + '\t' + tmp[14] + '\n')
    
fdIn.close()
fdOut.close()
