Help Needed

Hi

I have vi file in solaris machine with following information as below

Firstname: andy
Lastname: Mervyn
Phone : 12345

But, I need output in excel format in separate column as below using shell script

Firstname. Lastname.   Phone
 Andy.         Mervyn.      12345

So do your input files only have one (3 line) entry per file? If not, is there anything in the input file that separates records, or is it just that each entry is 3 lines?

Are the input lines always in the same order?

Are the headers constant, or are the headers derived from the input?
Does having no space before the colon in the input cause the header and the data field for that line to have a period added added to the end of that field on output? And, does having a space before the colon suppress the period? If not, what is the significance of sometimes having a space before the colon?

Why is there a space in the output before "Andy."?

What determines the number of spaces between output fields?

Did you intend for the header for each field to be aligned with the data under that header?

Hi Don Cragun

i Have uploaded the file and let me know if you have any questions

I downloaded your file. In your first message in this thread you said

Firstname: andy
Lastname: Mervyn
Phone : 12345

But, in the file I downloaded, the first line is "version: 1", the string "stname" never appears, the string "hone" never appears, every line ends with a carriage return and a newline, and there are 2,706 pairs of lines of the form:

"dn: uid=h440615,ou=sa,ou=mani,dc=example,dc=com"
name: mani phani  (

separated by empty lines (except for the carriage returns).

The first line in each pair seems to have a different uid= entry in each parir. In the 2,706 pairs, there are two different values for the first dc= entry in the line.

The second line in all 2,706 pairs is identical.

I have no idea what you expect to get from this 200,000+ byte file. I'm afraid I can't help you.

Hi

Sorry for not sending you proper inputs.

You can ignore "version: 1", and also you can remove double quotes for each dn: value.

Remaining all are correct.Since it is in ldap protocol langugage it might be starnage to you.There is no typo or errors.In my first post i have gave you sample example and i said 3 lines in single file.But its wrong.

what i attached file is correct.
Plese help me

lets take the first four lines for example. What is the expected output from these lines?

dn: uid=h435505,ou=sa,ou=mani,dc=example,dc=com
name: mani phani  (

dn: uid=h440615,ou=sa,ou=mani,dc=example,dc=com
name: mani phani  (

dn: uid=h377826,ou=sa,ou=mani,dc=example,dc=com
name: mani phani  (

dn: uid=h409794,ou=sa,ou=mani,dc=example,dc=com
name: mani phani  (