<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks for the reply, the output it's ok, none of the variabbles or values are null, i just want that the format appears like this:<br><br>29-12-10/11:43:01,0,250,0,/FIM<br>                                    0,/mytest<br>                                    0,/mockofprod/financing/customercentre<br>                                   
 0,/mockofprod/financing/commercial/amt<br>                                    0,/account/orderstatus<br>                                    0,/activities<br><br><br>--- El <b>mié 29-dic-10, m.roth@5-cent.us <i><m.roth@5-cent.us></i></b> escribió:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: m.roth@5-cent.us <m.roth@5-cent.us><br>Asunto: Re: [CentOS] Script Output Format<br>A: "CentOS mailing list" <centos@centos.org><br>Fecha: miércoles, 29 de diciembre de 2010, 11:59<br><br><div class="plainMail">Alejandro Rodriguez Luna
 wrote:<br>> i'm just did a script that the output must be comma separated to be<br>> imported into a spreadsheet.<br>><br>> the output that i obteined was<br>><br>> Date/Time,We. Active Threads,W. Total Threads,W. Worker Threads,Name<br>> 29-12-10/11:43:01,0,250,0,/FIM<br>> ,0,/mytest<br>> ,0,/mockofprod/financing/customercentre<br>> ,0,/mockofprod/financing/commercial/amt<br>> ,0,/account/orderstatus<br>> ,0,/activities<br>><br>> as you can see, the first row it's ok, but the second and third, etc etc,<br>> are not formated. any ideas of how can i achive this?<br>><br>> NOTE: the first three values are simple commands that i put in order, the<br>> fourth and fifth are from a file.<br>><br>> this is part of the code.<br>><br>><br>> printf "%s,%d,%d" $DATE $WSAT $WSTT >> output.${STANZA}.txt<br>><br>> for i in `cat jlist.${STANZA}.txt`<br>> do<br>>  
 JUNCTION=${i}<br>>   WSWJ=`pdadmin -a sec_master -p ${PASSWD} server task ${STANZA} show > ${JUNCTION} | grep 'threads' | awk '{ print $4 }'`<br>>   printf ",%d,%s\n" ${WSWJ} ${JUNCTION} >> output.${STANZA}.txt<br>> done<br><br>Well, it looks like $WSWJ is null. What's the output... hmmm, consider<br>that there may be more than one line with "threads", and that the fourth<br>element of the last line may not be what you want. (And you *could* just<br>do ...| awk {if ($0 ~ /threads/) { print $4;}}`)<br><br>         mark<br><br>_______________________________________________<br>CentOS mailing list<br><a ymailto="mailto:CentOS@centos.org" href="/mc/compose?to=CentOS@centos.org">CentOS@centos.org</a><br><a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br></div></blockquote></td></tr></table><br>