5

Fortmating text file - single col to X columns

view full story
linux-howto

http://www.unix.com – Hi, I have a large file with 100,000+ lines. Each line have a single value. How do I effiecntly format the text to be X number of commas spaced fields in width. i.e how do i turn this input: 26 53 79 80 81 82 111 131 135 139 192 193 198 199 203 209 210 215 218 219 220 221 222 223 224 225 226 Into this: 26, 53 ,79, 80, 81, 82 111, 131, 135, 139, 192, 193 198, 199, 203, 209, 210, 215 218, 219, 220, 221, 222, 223 224, 225, 226 Where i have specified the number of fields to be 6. I need to be able to set the number of fields as a variable. (HowTos)