Referring to this question : Finding missing value in text file
I have 2 files containing below data
Name Feature Marry Lecturer Marry Student Marry Leader Bob Lecturer Bob Student Som Student
Lecturer Student Leader
I'm following below code to find missing feature against any name in example file :
#!/bin/bash rm -f *.missing names.all feature=feature sed -n '1!p' example.txt | cut -d ' ' -f 1 | sort -u > names.all for i in $(cat $feature) do fgrep $i example.txt | cut -d ' ' -f 1 | cat - names.all | sort | uniq -u > $i.missing done
This code gives me 3 different files, like lecturer.missing, student.missing and leader.missing and contains all the name which doesn't have this feature.
but I want the data to be in same file and output should be :
I need ouput like this :
Lecturer Student Leader Som bob Som
I tried using appending the data in same file, but it doesn't work.