From: pere.noel@... (=?ISO-8859-1?Q?Une_b=E9vue?=) Date: 2006-11-25T21:40:08+09:00 Subject: Re: regexp working with mixed lines endings Paul Lutus wrote: > > Okay, the first ("\r") might be old-style Macintosh line endings. Here is a > solution for all the possibilities: > > data.gsub!(%r{(\r\n|\n\r|\r)},"\n") > > > > > does \n\r exists ? (wikipedia says NO) > > Doesn't matter. Someone might type it in manually. If it exists, the above > method will handle it. OK, thanks, i'll try that asap. > > > > also because the most part of the audio input file is "binary" datas > > there line ending is out of meaning, i suppose. > > What? You are reading binary files? Then don't try to filter line endings. BUT I DON'T have the choice the audio files i get does have metadatas writen in xml mixed with binary audio datas. The line endings are "correct" within the xml. I have to face with the output given by various recorders. i've uploaded in a *** truncated *** version of one of the file i'm getting the xml part, this file is named "bidule-truncated.wav" don't play it as an audio file because i've writen : [audio part truncated] in the middle of the audio part to make it lighter (4k instead of MBs). anyway thanks a lot helping me for that line endings ;-) > > If the file is text, you can filter line endings. Use the above method. > > If the file is not text, do not filter anything. then don't work... -- une b�vue