re: Search and substutiing text and adding in a carriage return?
From: FlashMX (FlashMX_at_sympatico.ca)
Date: 11/25/04
- Previous message: Gunnar Hjalmarsson: "Re: Using grep to check contents of file"
- Next in thread: Gunnar Hjalmarsson: "Re: Search and substutiing text and adding in a carriage return?"
- Reply: Gunnar Hjalmarsson: "Re: Search and substutiing text and adding in a carriage return?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "beginners@perl.org" <beginners@perl.org> Date: Thu, 25 Nov 2004 08:51:27 -0500
Hi,
How can I enter in a carriage return when doing a text substitution?
while ( <INPUT> ) {
if (/FIND_MATCH/) {
s/AAA/BBB CCC/;
}
Input file
=======
111 222 333 AAA
444 555 666 7777
Output file
========
111 222 333 BBB CCC
444 555 666 7777
Is it possible to have the output like so (with a carriage return)?
Output file
========
111 222 333 BBB
CCC
444 555 666 7777
- Previous message: Gunnar Hjalmarsson: "Re: Using grep to check contents of file"
- Next in thread: Gunnar Hjalmarsson: "Re: Search and substutiing text and adding in a carriage return?"
- Reply: Gunnar Hjalmarsson: "Re: Search and substutiing text and adding in a carriage return?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|