How to process an x-column text file to get a y-column one?
17
votes
9
answers
4591
views
I have a text file:
a aa aaa b bb bbb c cc ccc
d dd ddd e ee eee f ff fff
g gg ggg h hh hhh i ii iii
j jj jjj
How can I process it and get a 2 column file like this:
a aa
aaa b
bb bbb
c cc
ccc d
dd ddd
e ee
eee f
ff fff
g gg
ggg h
hh hhh
i ii
iii j
jj jjj
Or a three column file like this:
a aa aaa
b bb bbb
c cc ccc
d dd ddd
e ee eee
f ff fff
g gg ggg
h hh hhh
i ii iii
j jj jj
I prefer to get awk solution but other solutions are welcomed too.
Asked by Just a learner
(2022 rep)
Sep 8, 2016, 11:05 AM
Last activity: Jan 10, 2025, 03:49 PM
Last activity: Jan 10, 2025, 03:49 PM