I am working on a script to unfold data for each column from a specific line of data and write output in a single line.
Input data looks like this.
HTML Code:
2011-09-26 INF UM_10 UserMana Starting synchronization for security domain
14:37:31 080 gementSe [12345].
rvice
I prepared the script to unfold the above data
HTML Code:
#!/usr/bin/ksh
while read mDate mRest; do
if [[ ${#mDate} -eq 10 ]]; then
if [[ "${mOut}" != "" ]]; then
echo ${mOut}
fi
mOut=''
fi
mOut=${mOut}' '${mDate}' '${mRest}
done < Inp_File
if [[ "${mOut}" != "" ]]; then
echo ${mOut}
fi
The problem with this script is it simply cuts the data from 2nd and 3rd lines and attaches to the first line.
HTML Code:
2011-09-26 INF UM_10 UserMana Starting synchronization for security domain 08:45:10 080 gementSe [12345]. rvice
But I want the data to be like this:
HTML Code:
2011-09-26 14:37:31 INF UM_10080 UserManagementService Starting synchronization for security domain [12345].
Thanks,
Bob