0

what I have

what I want

What I got

I would like to have 2 status report that are next to each other but I dont want them to move, I want them to have a static position.

This what I use to merge:

paste -d, Status_Report_0.csv Status_Report_1.csv > Status_Report_Final.csv
column < Status_Report_Final.csv

EDIT1

so for clarification I wrote an example code I know I'm not using the merging of the echo's efficient but it works for me

(code is not able to paste correct...)

while(true) 
do 
 for i in 0 1 
 do
  echo "==============================================================" >     temp0_"$i".csv 
  echo -e "\033[1;34mround 432\033[0m" > temp1_"$i".csv 
  echo -e "\033[1;34mpinged 345 total times \033[0m\n----" > temp2_"$i".csv
  echo -e "\033[1;32mconnected 43 total times \033[0m" > temp3_"$i".csv
  echo -e "\033[0;37mdisconnected 304 total times\033[0m" > temp4_"$i".csv 
  echo -e "\033[0;37mdisconnected 23 last time\033[0m\n----" > temp5_"$i".csv 
  echo -e "package-loss 88% \n----" > temp6_"$i".csv

cat temp0_"$i".csv temp1_"$i".csv temp2_"$i".csv temp3_"$i".csv temp4_"$i".csv temp5_"$i".csv temp6_"$i".csv > Status_Report_"$i".csv

rm -f temp0_"$i".csv temp1_"$i".csv temp2_"$i".csv temp3_"$i".csv  temp4_"$i".csv temp5_"$i".csv temp5_"$i".csv

done

cat Status_Report_0.csv Status_Report_1.csv > Status_Report_Final.csv

column < Status_Report_Final.csv

done
3
  • 1
    Please, include the samples formatted as code, not as pictures. We can't copy'n'paste from screenshots to test our solutions.
    – choroba
    Commented Jun 28, 2018 at 9:19
  • images are not encouraged in posts, please post text samples in code tags and let us know then. Commented Jun 28, 2018 at 9:21
  • It is relatively easy to fix the width of the first file by piping it through printf("%-40s\n"). It requires multiple passes to find the longest line in the file, and set that as the width, or you can get the display width and halve it. If you go with a fixed width you might also want to print ... or > on lines that are too long. You could do that in both files. For 2 files being preformatted, the bash construct <() will be useful.
    – Gem Taylor
    Commented Jun 28, 2018 at 9:33

1 Answer 1

0

From here try:

paste Status_Report_0.csv Status_Report_1.csv | column -s$'\t' -t
2
  • Yes, this seems to work. It does some weird stuff with the colors but ill look into it. Thank you
    – JP de Rie
    Commented Jun 28, 2018 at 11:46
  • Right. I guess you would need to write your own script to work like column and handle colors ascii escape sequences. Look at this post.
    – KamilCuk
    Commented Jun 28, 2018 at 12:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.