Create HTML with Header and assign values

Hi All

Below is the output i have from my code

10.106.86.93 A1,A2,A2,A3,A3,A4,A5,A6,B1,B2,B3,B4,B5,B5,B6,B6,C1,C1,C2,C2,C3,C3,C4,C4,C5,C5,C6,D1,D2,D3,D4,D5,D6,D6 3

Need to create a html with header and for the last value (3) if it is 3 then it should print ok, if 4 then print NotOk

e.g.

Servername                       Index                                                                          Status 
10.106.86.93                         A1,A2,A2,A3,A3,A4,A5,A6,B1,B2,B3                       ok

The values in the above is separated by space.

Please let me know how to do this

Welcome to the forum.

Any attempts / ideas / thoughts from your side?

Why does the index output stop at B3 and suppresses the remainder of the field, B4 ... D6 ?
Where is the HTML part that you requested in the title?

Thanks..That was just an example i gave. so stopped at B3. the html part is the below e.g. mentioned.
i am new to bash and searching for help but not able to figure it out

Please become accustomed to provide decent context info of your problem.

It is always helpful to carefully and detailedly phrase a request, and to support it with system info like OS and shell, related environment (variables, directory structures, options), preferred tools, adequate (representative) sample input and desired output data and the logics connecting the two including your own attempts at a solution, and, if existent, system (error) messages verbatim, to avoid ambiguities and keep people from guessing.

This statement definitely in not enough! Nothing is mentioned anywhere. What should your final HTML file look like?

How did you produce the input data? What be your code that provides "the output i have from my code"?

1 Like

From the desired output you are looking for i suppose what you want to have is a HTML table. You may want to use this link to w3schools (english) or, if you happen to speak german, the phantastic SelfHTML to come up with a design you like. Simply try to manually create a HTML version of the example input you posted. Then post this HTML code and we can help you create a script to get the one from the other.

I hope this helps.

bakunin