Help with awk alignment

Dear All,

I am in the beginning stage of learning shell scripting and preparing shell script on my own now.

I would like to get help from fellow mates here.

As I am trying to take O/P with space included from I/P table.

Kindly guide me to align given I/P table as Expected O/P.

Example:
I/P:

 4444  7777  0000
1111    3333    5555
aaaa    bbbb    cccc     dddd     eeee
xxxx    yyyy    zzzzz    bbbb    mmm
9999    8888    7777    6666    4444

Expected O/P:

4444
1111            
aaaa    dddd    eeee
xxxx    bbbb    mmm
9999    6666    4444

Welcome to the forum.

Please specify exactly what you need and / or what you want to do so people in here don't need to guess from e.g. your output. Here it smells like "remove fields 2 and 3 from the input text file, outputting the result according to a non-given alignment."
Show your own attempts to solve the problem as well, even if they failed.

AND:

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.

Hi Rudic,

I am not allowed to disclose the data from my current organisation - UST Global Technologies and hence given sample data.
I am working on a script to take output from IBM MQ ffstsummary FDC files.
I have almost completed the script, but alignment problem still says with awk output.
I have attached exact sample data with this post that I am trying to achieve.

Given below code which created for my give task.

#!/usr/bin/ksh
dspmq | cut -d ")" -f1 | cut -d "(" -f2 > qmgr.txt
cat qmgr.txt | while read line
do
STATUS=`dspmq | grep $line | awk '{print $2}' | cut -d "(" -f2 | cut -d ")" -f1`
if [[  $STATUS == "Running" ]]
then
cd /var/mqm/errors
ffstsummary | awk '{print $1,$2,$4}' > "$line"_FDC_RECORD.txt
#mailx -s "$line"_FDC_RECORD.txt (mailID) < "$line"_FDC_RECORD.txt
fi
done

Which of the samples should we use for guessing your requirement? With the new one, it would be like "Remove ALL fields except 1, 2, and 4 RECOGNIZING some fields are empty"? How to detect empty fields? Or would that be every other field beyond field 2? What be the field separator in the last sample?

Kindly consider my attached sample data with I/P , O/P & expected O/P.
Though vi editor I can move my cursor with each alphabet space with that complete space for field 2 and 4 under row 1 & 2.

Hi Raja007. Could you please answer RudiC's questions?