Skip to main content
added 301 characters in body
Source Link
Md Wasi
  • 123
  • 6

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script. But in actual when i run script then it is showing like-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

So I want to arrange like above content of the output. Where I used in the script for the above requirement-

 for f in abc.txt def.txt xyz.txt; do (cat "${f}"; echo) >> output.txt; done |awk '{printf "%-10s|%-10s|%-10s|%-10s|%-10s|%-10s|%-10s\n",$1,$2,$3,$4,$5,$6,$7} output.txt > final_output.txt 

Is it good approach to generate the script

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script. But in actual when i run script then it is showing like-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

So I want to arrange like above content of the output.

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script. But in actual when i run script then it is showing like-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

So I want to arrange like above content of the output. Where I used in the script for the above requirement-

 for f in abc.txt def.txt xyz.txt; do (cat "${f}"; echo) >> output.txt; done |awk '{printf "%-10s|%-10s|%-10s|%-10s|%-10s|%-10s|%-10s\n",$1,$2,$3,$4,$5,$6,$7} output.txt > final_output.txt 

Is it good approach to generate the script

added 208 characters in body
Source Link
Md Wasi
  • 123
  • 6

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script. But in actual when i run script then it is showing like-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

So I want to arrange like above content of the output.

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script.

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script. But in actual when i run script then it is showing like-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

So I want to arrange like above content of the output.

Source Link
Md Wasi
  • 123
  • 6

Generate the output of the file in the next line

I have 3 files ex- abc.txt, def.txt & xyz.txt. I've generate one shell script where I want to content of these 3 files should appear line wise like as below-

abc ---- 1 2 3 4 5 6 7 def ---- 3 5 7 9 11 13 15 xyz ---- 4 8 12 16 20 24 28 

Also the content of the files should be like this manner & every value in parallel wise. Could you please help me to generate the shell script.