Help - Search - Members - Calendar
Full Version: Shell Script Problems
Linuxhelp > Support > Programming in Linux

I'm having trouble with formatting some text via the terminal. I can get it perfectly formatted, but when I try and copy paste the text from the output file it loses it's formatting. Very frustrating!

Basically I have 7 files (data data2 data3 data4 data5 data6 data7) containing a column of information each. I merge them all into one output file, with a separate column for each input file using:

paste data data2 data3 data4 data5 data6 data7 | awk '{printf "%-12s%-12s%-12s%-12s%-12s%-12s%-12s\n", $1, $2, $3, $4, $5, $6, $7}' > output

The result looks good in the output file and when the output is displayed in the Terminal, but when I copy paste from the output file into another file the columns become all jumbled.

I've also tried:
pr -m -t data data2 data3 data4 data5 data6 data7 >| expand > output

I have no idea what to do to solve this, any help would be greatly appreciated.

What editor are you using?
Understand it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.