From: Hermann Peifer on
On 27/06/2010 12:00, Dominic Fandrey wrote:
> On 22/06/2010 15:40, Ed Morton wrote:
>> On 6/22/2010 3:51 AM, Dominic Fandrey wrote:
>>> On 21/06/2010 19:36, lloyd wrote:
>>>> A textfile looks like this:
>>>>
>>>> word1 word2 word3 word4 word5 word6 ...
>>>>
>>>> I want to make it look like this:
>>>>
>>>> word1 word2
>>>> word2 word3
>>>> word3 word4
>>>> word4 word5
>>>> ...
>>>>
>>>> so that every adjacent pair of words appears as one line of the new
>>>> file.
>>>> Can someone give me a quick clue how to accomplish this? Many thanks.
>>>
>>> rs 0 2< OLDFILE> NEWFILE
>>>
>>> works for me.
>>>
>>
>> I've never heard of "rs" and I don't have it on any machine I use. What
>> does it do and what does it's output look like given the above input?
>
> Oh, I'm sorry. It came up with 4.2 BSD and lets you do stuff like
> defining rows and columns (0: auto #rows, 2: 2 columns) or perform
> matrix transformations (-T).
>
> My guess was that it went into Sys V like most of the early BSD
> stuff and hence was widely available.
>
> # echo word1 word2 word3 word4 word5 word6 ... | rs 0 2
> word1 word2
> word3 word4
> word5 word6
> ...
>

Yet another solution that doesn't do what the OP asked for.

OP asked for | your solution
--------------+---------------
word1 word2 | word1 word2
word2 word3 | word3 word4
word3 word4 | word5 word6


Hermann
From: Loki Harfagr on
Sun, 27 Jun 2010 12:20:08 +0200, Hermann Peifer did cat :

> On 27/06/2010 12:00, Dominic Fandrey wrote:
>> On 22/06/2010 15:40, Ed Morton wrote:
>>> On 6/22/2010 3:51 AM, Dominic Fandrey wrote:
>>>> On 21/06/2010 19:36, lloyd wrote:
>>>>> A textfile looks like this:
>>>>>
>>>>> word1 word2 word3 word4 word5 word6 ...
>>>>>
>>>>> I want to make it look like this:
>>>>>
>>>>> word1 word2
>>>>> word2 word3
>>>>> word3 word4
>>>>> word4 word5
>>>>> ...
>>>>>
>>>>> so that every adjacent pair of words appears as one line of the new
>>>>> file.
>>>>> Can someone give me a quick clue how to accomplish this? Many
>>>>> thanks.
>>>>
>>>> rs 0 2< OLDFILE> NEWFILE
>>>>
>>>> works for me.
>>>>
>>>>
>>> I've never heard of "rs" and I don't have it on any machine I use.
>>> What does it do and what does it's output look like given the above
>>> input?
>>
>> Oh, I'm sorry. It came up with 4.2 BSD and lets you do stuff like
>> defining rows and columns (0: auto #rows, 2: 2 columns) or perform
>> matrix transformations (-T).
>>
>> My guess was that it went into Sys V like most of the early BSD stuff
>> and hence was widely available.
>>
>> # echo word1 word2 word3 word4 word5 word6 ... | rs 0 2 word1 word2
>> word3 word4
>> word5 word6
>> ...
>>
>>
> Yet another solution that doesn't do what the OP asked for.
>
> OP asked for | your solution
> --------------+---------------
> word1 word2 | word1 word2
> word2 word3 | word3 word4
> word3 word4 | word5 word6
>
>
> Hermann
Sign of the times, I'd say it is, sadly, probably a sequel of glub2.0, people living by the twitting don't read more than one hundred and fo