Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
arun 36985
arrunav 25871
elarital 48734
depaal 43212
sujan 23467
my data is in this form i need to replace space with comma in perl script than how can i write the code for the above data

my data out put should be arun,36985
arrunav,25871
elarital,48734
depaal,43212
sujan,23467
Posted

1 solution

See, for instance, here: SEARCH & REPLACE[^].
e.g.
PERL
$s = "arun 36985";
$s =~ s/ /,/;
print $s


output:
arun,36985
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900