Formatting the Output

Hi,

I am trying to use printf command and format certain output in a specific format as under:

While the left side (upto |) of the above format is part of a fixed header function, the right side is where i am expecting data to be printed. However, as seen, Row1 value is reflecting on last (against Row3). :confused:

Could anyone help me in formatting this in the right way please.

Thank you..

Whats the command you are using right now? and these data is in file or something?

Thank you for a quick response vidyadhar85
Details are as under

And in the main program, the data is collected from file + command line arguments

outputs printed are after calling

Why dont you pass those argument to your header function then? It would be easy to print it side by side then..

Header is the constant output format and passing the values to header function needs a lots of modifications in major chunk of my script(which actually when tried is destroying the complete script).

So had to sought for this approach..

so you want to print $1 infront of Row1 and $2 infront of Row2 so on so forth? I dont know whats your entire script do without that it would be tough to provide solution however you can take a look at tput cup <row> <column> command to reposition your cursor... or you have to use paste command with the help of storing values in some variables