shell or perl script needed for ldif file to text file conversion


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell or perl script needed for ldif file to text file conversion
# 1  
Old 04-22-2011
shell or perl script needed for ldif file to text file conversion

This is the ldf file

dn: sdcsmsisdn=1000000049,sdcsDatabase=subscriberCache,dc=example,dc=com
objectClass: sdcsSubscriber
objectClass: top
postalCode: 29600
sdcsServiceLevel: 10
sdcsCustomerType: 14
givenName: Adelia
sdcsBlackListAll: FALSE
sdcsOwnerType: T-Mobile
sn: Actionteam
sdcsAccountStatus: active
sdcsCustomerId: 49
sdcsMsisdn: 1000000049
sdcsTimestamp: 20091120215911Z
ds-entry-unique-id:: JMYDmDjJRO2ZuZyJNy+u3Q==
ds-update-time:: AAABKCIkQn4=
ds-create-time:: AAABKCIkQn4=
creatorsName: cn=Directory Manager,cn=Root DNs,cn=config
modifiersName: cn=Directory Manager,cn=Root DNs,cn=config

dn: sdcsmsisdn=1000000051,sdcsDatabase=subscriberCache,dc=example,dc=com
objectClass: sdcsSubscriber
objectClass: top
postalCode: 61671
sdcsServiceLevel: 3
sdcsCustomerType: 76
givenName: Adelina
sdcsBlackListAll: FALSE
sdcsOwnerType: T-Mobile
$ head -50 output.ldif
dn: dc=example,dc=com
objectClass: domain
objectClass: top
dc: example
ds-sync-generation-id: 249287103
ds-entry-unique-id:: VMicRTJ7PTiKLreBTeZRpA==
ds-sync-state: 0000012F4D618697103601BA8A19
ds-sync-state: 0000012F4D61806B582F01C46148
ds-sync-state: 0000012822FE4A99580300000003
ds-sync-state: 0000012F4D6186EA2EB204A888F1
ds-sync-state: 0000012A6AAAB90745AE0008165F
ds-sync-state: 0000012A81FDF1CA371F00006AC7
ds-sync-state: 0000012823020EA5156100000002
ds-sync-state: 0000012F4D6186965AD401BAF320
aci: (targetattr!="userPassword")(version 3.0; acl "Allow anonymous read access for anyone"; allow (read,search,compare) userdn="ldap:///anyone"Smilie
aci: (targetattr="*")(version 3.0; acl "Allow users to update their own entries" ; allow (write) userdn="ldap:///self"Smilie

I'm looking for Postalcode, sdcsServiceLevel, sdcsCustomerType, sdcsAccountStatus, sdcsCustomerID, sdcsMsisdn, sdcsFeature, sn, givenName values to be extracted and put in the text file as



29600,10,14,active,49,1000000049,,Actionteam,Adelia


---------- Post updated at 04:28 PM ---------- Previous update was at 04:28 PM ----------

the last one is text file format . Urgent please
# 2  
Old 04-23-2011
there are multiple postal code??

regards,
Ahamed

Last edited by ahamed101; 04-23-2011 at 02:44 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Needed shell script to append desired text to each line in a file

Hi, I had generated a report in my tool as followsoutput.txt 43.35 9 i needed the script to generate a new file like below i want to append the text to each of these lines of my filenewoutputfile.txt should be Total Amount : 43.35 Record Count:9 Regards, Vasa Saikumar. ... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

2. Shell Programming and Scripting

Help required for Oracle database shutdown script conversion from shell to perl

Please tell me how to convert below program from shell script to perl. Same commands need to use in shutdown, just need program help for startup. export ORACLE_BASE=/home/oracle1 lsnrctl start lndb1 sqlplus '/ as sysdba' startup; (2 Replies)
Discussion started by: learnbash
2 Replies

3. Shell Programming and Scripting

Help needed in calling path file from Perl script.

Hi All, I need help in accessing a path file (path.xyz_pqr) not having a shell shebang and exporting paths in the following syntax, export DB_SCRIPT_PATH="/abc/aash/scripts/db_scripts/xyz_pqr" export SRC_FILES_DIR="/bcd/fdw/incoming/xyz_pqr" I need to use the path contained in the... (8 Replies)
Discussion started by: xtatic
8 Replies

4. Shell Programming and Scripting

KSH - help needed for creating a script to generate xml file from text file

Dear Members, I have a table in Oracle DB and one of its column name is INFO which has data in text format which we need to fetch in a script and create an xml file of a new table from the input. The contents of a single cell of INFO column is like: Area:app - aam Clean Up Criteria:... (0 Replies)
Discussion started by: Yoodit
0 Replies

5. Shell Programming and Scripting

Conversion of spaces Text file into CSV format file

Input file (each line is separaed by spaces )given below: Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- -----... (18 Replies)
Discussion started by: sreenath1037
18 Replies

6. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

7. Shell Programming and Scripting

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Discussion started by: casmo
5 Replies

8. Shell Programming and Scripting

Help me with file conversion [Shell Script]

Hello Group, I request your help with a shell script for filter an ascii file (this is small piece of the file): 09/24/2009,00:00,1.0268,1.0268,1.0249,1.0250,518 09/24/2009,01:00,1.0251,1.0261,1.0249,1.0259,424 09/24/2009,02:00,1.0258,1.0272,1.0258,1.0269,372... (3 Replies)
Discussion started by: csierra
3 Replies

9. Shell Programming and Scripting

Simple Script needed for Processing CSV file perl

I am new to perl, and need a script to pull a CSV file, strip out 2 leading columns, and 2 ending columns, and resave the file in a new location. The file is basic and has less than 10,000 records. Secondly, can I schedule perl scripts to run daily? Can someone provide the basic script to... (1 Reply)
Discussion started by: cobbjob
1 Replies

10. Shell Programming and Scripting

shell scripts to grep dn in ldif file

Hi gurus out there, 1)I am using ksh, in solaris 10. 2)I have one ldif file, I need to output user DN with attributes=<some pattern> to a file. Example: dn: uid=joy,ou=People,o=abc.com,o=isp nswmExtendedUserPrefs: meAutoSign=true nswmExtendedUserPrefs: meSignature=Regards, Joy... (3 Replies)
Discussion started by: bulkbiz
3 Replies
Login or Register to Ask a Question