I have an output.txt from running a shell script as follows:
abc.txt
errorstatus1
Fri Nov 11 02:00:09 2016
def.txt
errorstatus2.txt
Sat Nov 12 03:00:09 2016
The text file has multiple entries line by line in the same manner. I want to print these values into columns: Filename,Status and Timestamp as follows:
Filename Status Timestamp
abc.txt errorstatus1 Fri Nov 11 02:00:09 2016
def.txt errorstatus2 Sat Nov 12 03:00:09 2016
Best Answer
With
paste
:this will output the newline separated file content as columns, and three tab separated columns per line.
Adding the header:
To columnize the output, take help from
column
:Example: