LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Parsing Fields LDAP (https://www.linuxquestions.org/questions/linux-software-2/parsing-fields-ldap-480411/)

wwnexc 09-04-2006 05:41 PM

Parsing Fields LDAP
 
Hi,

I have just exported my LDAP, and i am trying to make a list with all user login names, along with their real names and departments.

I tried doing so with the "cut" command, but cut cuts inside "quotation, marks". This way, i have two fields inside the quotation marks, which i don't want. Is there any way to select these fields, for user-id, first name, and last name, and put them in a list?

acid_kewpie 09-05-2006 09:52 AM

some sample output would be nice....

archtoad6 09-14-2006 12:35 PM

Yes, some sample output, please.

wwnexc 09-14-2006 06:08 PM

Code:

dn: CN=Connector for Lotus Notes (EX1),CN=Connections,CN=First Routing Group,CN=Routing Groups,CN="First Administrative Group, Networking",CN=Administrative Groups,CN=VINC,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=vinc,DC=biz changetype: modify replace: msExchExportContainersLinked msExchExportContainersLinked: OU=GroupWise Users,DC=vinc,DC=biz msExchExportContainersLinked: OU=AD Users,DC=vinc,DC=biz msExchExportContainersLinked: CN=Users,DC=vinc,DC=biz
,CN="First Administrative Group, Networking",

The above should only be one field, within the two commata. "First Administrative Group, Networking" should not be parsed as two fields, because the comma is inside the quotation marks.

Sorry for answering so late: The spam blocker blocked the email notification of the response... My bad.

archtoad6 09-15-2006 03:17 AM

Can you change the exported field separator (i.e. in LDAP)?

Can you specify a <Tab>, which is cut's default field separator, instead of the current comma? This would kill the proverbial 2 birds w/ one stone -- the commas inside quotes would be distinguished from the field separators, & there would be no need to change the separator in the cut command.


All times are GMT -5. The time now is 11:50 AM.