Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- head1 head2 head3
- a b c
- c
- c a
- head1 head2 head3
- a b c
- - c -
- c - c
- perl -ne '
- while (length) {
- ($word = substr($_,0,10)) =~ s/^s+|s+$//g; # trim whitespace
- $word ||= "-";
- print $word, " ";
- substr($_,0,10) = "";
- }
- print "n";
- ' file
- sed 's/^ //g' input | tr -s "[:blank:]" "," |
- awk -F, '!$1{printf "- "} $1{printf "%s ", $1}
- !$2{printf "- "} $2{printf "%s ", $2}
- !$3{print "-"} $3{print $3}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement