[YLUG] Manipulation of text files... anyone with lots of experience?

Tom Hayward nessieliberation at gmail.com
Mon Jul 28 23:07:16 BST 2008


bummer (sic) - thought there were some fun pints in that... if only i
hadn't been watching tele for the last few hours

2008/7/28 Dan Bishop <dan at viciouslime.co.uk>:
> Thank you so much Nigel! That worked perfectly, you win the pints :D
>
> I'll look into CPAN too. Thanks again, I really can't tell you how much
> that's helped me!
>
> Dan
>
> On Mon, 2008-07-28 at 21:37 +0100, Nigel Metheringham wrote:
>> On 28 Jul 2008, at 20:49, Dan Bishop wrote:
>>
>> > Basically, I have
>> > read as much as I ever care to read about sed, awk and regular
>> > expressions and have hit the point where I don't care how it
>> > happens, I
>> > just want it to happen.
>>
>> Its potentially just about doable as a regular expression
>> transformation, but frankly it would be a pretty impressive
>> transformation.  In which case you could express it in sed, its
>> definitely doable in awk, but my weapon of choice for this stuff is perl
>>
>> [And I have this horrid suspicion that if you searched CPAN you might
>> find a module that deals with this form of dictionary.]
>>
>> I've attached a bit of perl that does what you want on the assumption
>> that all the definitions are each on a single line (ie that the
>> Abenteuerreise definition should have not been split across 2 lines).
>>
>> If that assumption cannot be supported then you need to have some
>> rules defining how lines can be split otherwise it gets really really
>> messy.
>>
>>       Nigel.
>> --
>> [ Nigel Metheringham             Nigel.Metheringham at InTechnology.com ]
>> [ - Comments in this message are my own and not ITO opinion/policy - ]
>
> _______________________________________________
> York mailing list
> York at lists.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/york
>
>



More information about the York mailing list