Command can do the reverse of what the paste command does

pastetext processing

The paste command can merge multiple lines into one. For example, if I have a file test.txt and it contains:

original text

a
aa
aaa
b
bb
bbb
c
cc
ccc

I can use the command paste -s -d '\t\t\n' test.txt to get:

processed result

a   aa  aaa
b   bb  bbb
c   cc  ccc

I want to know if there is a reverse command that can do the reverse of paste. For example, If I have "processed result", how can I get "original text"?

Best Answer

There's no standard command.

You must do it your self, and depends on your input.

In this case:

tr '\t' '\n' <pasted_file.txt

will give you the original one.

Note that it assumes \t doesn't appear in your original file.

Related Question