Advertisement

03.12.2008 at 04:06PM PDT, ID: 23237049
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.8

Perl one liner to remove a line that carries over to another new line which starts with a space

Asked by bt707 in Perl Programming Language

I need a perl one liner, I need to remove some fields from a ldap dump to give to Sun for some troubleshooting, the problem I have is I can remove the lines I need but not everything. The way the ldap records work is if there is a line that carries over to another line there is a space at the first of the line which tell ldap that it is one line.

The ldap dump I have is now just a text file but if I remove the lines I need it does not remove the rest of the line on the attributes I'm removing if there is a carry over to a new line.

Example:

In this part of a example I'm I need to remove the homePostalAddress: which if I remove it a few ways that I know how I just remove the line of homePostalAddress: 65 Millfield Lane,  Nether Poppleton,  York,  YO26 6NB,  Un, but the continuation of that attribute is carried over to the next line so the ( ited Kingdom,) is not removed.


dn: cn=John Doe  100397,ou=employee,o=abc,c=ou
modifyTimestamp: 20080308162306Z
modifiersName: cn=John Doe 100397,ou=employee,o=abc,c=ou
schedule: 2008
schedule: Jan 08-10 : La Defense , Paris , France
schedule: Jan 13-19 : Austin / Houston TX , USA : WS Review
schedule: Mar 09-14 : Brega/Benghazi/Tripoli, Libya
schedule: Mar 18    : London , client visit (Tullow)
schedule: Apr 06-22 : Port Gentil,Pointe Noire,Luanda,Cabinda,J'burg,Cape Town
schedule: Apr28-01May: La Defense / Clamart , Paris
lastModifiedBy: self
homePostalAddress: 65 Millfield Lane,  Nether Poppleton,  York,  YO26 6NB,  Un
 ited Kingdom,
businessCategory: O530-WCS Staff
locationCode: WSV


I'm trying to find a perl one liner where it would make the above example come out to be:


dn: cn=John Doe  100397,ou=employee,o=abc,c=ou
modifyTimestamp: 20080308162306Z
modifiersName: cn=John Doe 100397,ou=employee,o=abc,c=ou
schedule: 2008
schedule: Jan 08-10 : La Defense , Paris , France
schedule: Jan 13-19 : Austin / Houston TX , USA : WS Review
schedule: Mar 09-14 : Brega/Benghazi/Tripoli, Libya
schedule: Mar 18    : London , client visit (Tullow)
schedule: Apr 06-22 : Port Gentil,Pointe Noire,Luanda,Cabinda,J'burg,Cape Town
schedule: Apr28-01May: La Defense / Clamart , Paris
lastModifiedBy: self
businessCategory: O530-WCS Staff
locationCode: WSV


Thanks for any help on thisStart Free Trial
[+][-]03.12.2008 at 04:30PM PDT, ID: 21111884

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.12.2008 at 04:38PM PDT, ID: 21111928

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628