Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to remove new line and all white spaces in one line of command in Perl?

Posted on 2011-10-11
3
Medium Priority
?
193 Views
Last Modified: 2012-05-12
Hi,

How can combine the following two commands in one line?

$text=~s/\n//g; 
$text=~s/\s+//g;

Open in new window

0
Comment
Question by:Tolgar
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 2000 total points
ID: 36949632
$text=~s/\n/|\s+//g;
0
 

Author Comment

by:Tolgar
ID: 36956901
I think there is a syntax error in here. Can you please double check?

Thanks,
0
 
LVL 31

Expert Comment

by:farzanj
ID: 36956912
Yes, sorry.

Please test this and let me know ASAP
$text=~s/\n|\s+//g;
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question