RE: Merging lines in a file

2004-08-29 Thread Jan Eden
Hi, thanks for all the suggestions. I originally tried to avoid slurping the whole file into memory, but got stuck using the $. variable to address a line and the one following it. Thanks John and Gunnar for pointing me to the right direction, and thanks to Charles for his extensive comments.

Re: Merging lines in a file

2004-08-29 Thread John W. Krahn
Jan Eden wrote: Hi, Hello again, I had the following task: Open a file, read it and merge all pairs of lines containing a certain number of tabs. Example: Blablabla abc cab bca 123 453 756 Blablabla Blablabla Here, lines 2 and three should be merged, while the other lines should remain untouched.

RE: Merging lines in a file

2004-08-29 Thread Charles K. Clarkson
Jan Eden <[EMAIL PROTECTED]> wrote: : I had the following task: Open a file, read it and merge all : pairs of lines containing a certain number of tabs. Example: : : Blablabla : abc cab bca : 123 453 756 : Blablabla : Blablabla : : Here, lines 2 and three should be merged, while the other : line

Re: Merging lines in a file

2004-08-29 Thread John W. Krahn
Jan Eden wrote: Hi, Hello, I had the following task: Open a file, read it and merge all pairs of lines containing a certain number of tabs. Example: Blablabla abc cab bca 123 453 756 Blablabla Blablabla Here, lines 2 and three should be merged, while the other lines should remain untouched. Expec

Re: Merging lines in a file

2004-08-29 Thread Gunnar Hjalmarsson
Jan Eden wrote: I had the following task: Open a file, read it and merge all pairs of lines containing a certain number of tabs. Example: Blablabla abc cab bca 123 453 756 Blablabla Blablabla Here, lines 2 and three should be merged, while the other lines should remain untouched. Expected result: B