Do you really mean textual attribute or just Categorical attribute? e.g. if an attribute has three values $a$,$b$ and $c$ it does not mean that you need to work with text but just categories. Here I assume you have really textual attribute e.g.
| attr1: Age | attr2: msg |
| ------------- |---------------------------------------|
| 45 | I do NLP |
| 21 | I do math |
| 34 | I am a mathematician who does NLP |
In this case you have 2 options; either going for classic ways like Bag of Words representation of text data and counting frequency of terms (words/bi-grams/tri-grams/etc.) and see how it works, or try to shortcut the way if you have a specific corpus with specific info to be extracted e.g. in example above a "Keyword Extraction" after a Stemming step will give you a vocabulary of fields in each of which a person can get a value ($0,1$).
For K-means, one should have in mind that it works with numerical data. So if you want to use it, first you need to embedd your text into a n-dimensional space using text embedding algorithms (word2vec, doc2vec, etc) or even using frequency terms (as they are numbers) but the problem with text embedding is that despite you want to train your own Neural Network (which needs descent amount of data) you have to use pre-trained NNs which might not work well if your corpus is about a very specific kind of text.
The other point is that KNN algorithm is supervised and k-means is unsupervised. So be careful that you understood the underlying concepts properly otherwise you will end up with improper results.