[BUGS] search/replace - cr/lf (with joe)

harrywwc harry at woodward-clarke.com
Thu Jul 31 06:45:59 EST 2008


Hi JLM,

not sure if this can be done with Joe...

/me shudders at the thought of 'WordStar'...

anyway, another method if you are uncomfortable with tr(1) is 
dos2unix(1) to convert cr/lf to lf and unix2dos(1) to do the reverse.

I think they're part of the 'mstools' package.

take care,

.h

jonathan michaels wrote:
> greetings,
> 
> andrew
> 
> i didn't think of doing it like that but bow that makes sence 
> 
> 
> On Thu, Jul 31, 2008 at 12:40:41AM +1000, Andrew wrote:
>>
>> On Thu, 31 Jul 2008, jonathan michaels wrote:
>>
>>> and wa wondering about how to replace teh combination of
>>> carriage return and line feed symbols frm teh end of line and
>> I've never used joe but you can just do it from the command line:
>>
>> tr -d \\r < file.csv > file_unix.csv
>>
>> That just strips all CRs so if you have any in your actual data you will 
>> want to use something a bit smarter but it will work for 99% of common 
>> data.
> 
> going onto another stream .. i'm editing the maintenance
> reports to strip the ip address data to put into the
> blockhosts.txt file to feed to pf for keeping bad
> ipaddresses/attacks ets out side teh firewall.
> 
> this also requires a search and replace for cr/lf markers, does
> anyone know how to do this with joe ?? please
> 
> regards appreciations and much thanks andrew
> 
> jonathan
> 


-- 

harry [at] woodward-clarke [dot] com
imago Dei in quolibet homine' inveniartur


More information about the BUGS mailing list