Pack text data into structs and vice versa