First of all, transactions are not lines or strings. They are just data in a specific format.
You can store any sequence of bytes (aka any data) that you want in the blockchain. However just because you can does not mean that you should. Storing your data means that thousands of nodes must also store your data, and that is a lot of disk space and computer power that needs to go towards storing your data for eternity. Storing arbitrary data on the blockchain is rude to node operators and everyone else that uses Bitcoin as you are taking up block space that could otherwise be used for actual transactions. So yes, you can store data, but you really shouldn't.
wow, really like this explanation, thanks for it.