Hi Team,
I have input like
Input file.txt
Contents:
Total: 939720704 bytes
Total: 521142272 bytes
Total: 262144 bytes
Total: 786432 bytes
Total: 9043968 bytes
Total: 9371648 bytes
I need out put like the content of file should be side by side.that is 1st line beside to that 2nd line again new line etc...this should repeat for n number of lines of given input.
TITL1 TITLE2
Total: 939720704 bytes Total: 521142272 bytes
Total: 262144 bytes Total: 786432 bytes
Total: 786432 bytes Total: 786432 bytes
Total: 9043968 bytes Total: 9371648 bytes
can somebody help me this
Hi
Something like this?
$ cat a
Total: 939720704 bytes
Total: 521142272 bytes
Total: 262144 bytes
Total: 786432 bytes
Total: 9043968 bytes
Total: 9371648 bytes
$ sed 'N;s/\n/ /' a | awk 'BEGIN{print "TITLE1\t\t\t\t\tTITLE2";}1'
TITLE1 TITLE2
Total: 939720704 bytes Total: 521142272 bytes
Total: 262144 bytes Total: 786432 bytes
Total: 9043968 bytes Total: 9371648 bytes
$
Guru.
yazu
June 23, 2011, 9:15am
4
% cat > testfile
Input file.txt
Contents:
Total: 939720704 bytes
Total: 521142272 bytes
Total: 262144 bytes
Total: 786432 bytes
Total: 9043968 bytes
Total: 9371648 bytes
% printf "%-30s%-30s\n" Title1 Title2; \
tail -n+3 testfile | paste - - |
awk '{ printf "%-30s%-30s\n", $1 " " $2 " " $3, $4 " " $5 " " $6}'
Title1 Title2
Total: 939720704 bytes Total: 521142272 bytes
Total: 262144 bytes Total: 786432 bytes
Total: 9043968 bytes Total: 9371648 bytes