Ruby ???

james tate binarynut at comcast.net
Thu May 19 19:55:42 UTC 2011


On 05/19/2011 03:23 PM, Mikkel L. Ellertson wrote:
> On 05/19/2011 09:17 AM, james tate wrote:
>> On 05/19/2011 09:24 AM, Mikkel L. Ellertson wrote:
>>> I would probably do something like:
>>>
>>> sed -e "s@^[0-9]*[ ]*@@" input.file>   output.file
>>>
>>> This not only removes the line numbers, but the spaces after them as
>>> well. If what shows up as spaces in the posting are really tabs, a
>>> small change is required:
>>>
>>> sed -e "s@^[0-9]*\t@@" input.file>   output.file
>>>
>>> This also has the advantage of only removing the first tab, and
>>> leaving all the other formatting the same. The first version will
>>> remove all the spaces after the number until it hits a non-space
>>> character. That would probably mess up any indentation in the script.
>>>
>>> Mikkel
>> Well !!  If I knew anything about Ruby, I wouldn't have done it the hard
>> way.
> Maybe one of these days I will have to learn something about Ruby. I
> just know a little bit about changing the format of a file. You may
> want to learn about sed, and a few other command line tools like
> awk, cut, tr, etc...
>
> Mikkel
Believe me I'm working on it.

Thanks


More information about the users mailing list