For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > May 2006 > Search and Replace









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Search and Replace
subha

2006-05-24, 7:59 am

Hi,

I wrote Perl Scripting for Alignment.

I had a Text file in which data was unaligned and with my 2 lines
coding i aligned the data.
data was something like this:

FirstName LastName Email1
--->Email2 Date Time Timetype

Output should be in one line

Name(first & Last) Email1 Email2 Date Time
Timetype

I used the code

$replace_file =~ s/\n\-\-\-\> /\t/g;
$replace_file =~ s/\s\s+/\t/g;

to get above output, but the problem comes when the user has middle
name even

if there is middle name i am getting output like

Name(first,middle, Last)Email1 Email2 date time
timetype

Can anyone help me out with this.

thanks in advance
subha

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com