I have a file named output and it is formatted like this
uid=xxxxxxxx
mail=xxxxxxxxxxx
usfvaultgrp=SECURITY
usfvaultuserkey=mOiGd+od8is=
USFLdapAdminRole=super
cn=Walter
sn=Walter
gecos=Scott Walter
objectClass=top
objectClass=person
objectClass=organizationalPerson
objectClass=inetorgperson
objectClass=posixAccount
objectClass=shadowAccount
objectClass=account
objectClass=usfperson
telephoneNumber=xxxxxxx
givenName=Scott
homeDirectory=/net/home/swalter
gidNumber=7
uidNumber=1003
uid=swalter
loginShell=/bin/ksh
uid=TSC
mail=xxxxxxxxxxxxx
objectClass=top
objectClass=person
objectClass=organizationalPerson
objectClass=inetorgperson
telephoneNumber=xxxxxxxxx
givenName=Help
sn=Desk
uid=TSC
cn=Help Desk
with many more sections. I am putting a line in my script that says
Code:
awk '{ FS="\n" ; OFS="," ; RS="^$" ; ORS="\n" ; print ; }' output > file
My understanding is it should take each line in a section, change it to a csv line, and each section should be a new line. However, I get an error
Code:
migrrufrsa01:jlake> ./script
awk: record `mail=xxxxxxxxxxxxxxxx...' too long
record number 1
host:jlake>