awk problem

I am trying to isolate a username that contains spaces

my input is like :

 
username          fullname
---------------------------------------------
SYSTEM              SYSTEM
quarantine           quarantine
nigel                   Nigel Hope
glennrosegarden   Glenn Rose-garden
Rachel Sharpe      Rachel Sharpe
Sue Purkins          Sue Purkins
Anthony              Anthony Loft
Stephanie Crooke  Stephanie Crooke
Hannah Northern   Hannah Northern
Darren Maynot      Darren Maynot
Pauline E Dawson  Pauline E. Dawson
Simon Parkin         Simon Parkin
 

I am using

awk 'BEGIN {FS= "  ";} {print $1}'

to try and isolate the first field

but it dosent work - any ideas ????

---------- Post updated at 09:04 AM ---------- Previous update was at 09:01 AM ----------

ugh this forum strips out the whitespace between the fields !!!

username_______fullname
---------------------------------------------
SYSTEM_______SYSTEM
quarantine_______quarantine
nigel_______Nigel Hope
glennrosegarden_______Glenn Rose-Garden

i have shown it again using _ to represent those spaces

I hope it gives you enough idea of what im trying to achieve

Space is default field separator. You don't need to set it explictly.
If you want to print only 1st column then

awk '{print $1}' inputFile

should work.
If you don't want 1st two header lines then

awk 'NR>2{print $1}' inputFile

the problem is that the first field actually contains spaces sometimes
valid fields are

glennrosegarden
Rachel Sharpe
Pauline E Dawson

the difference that i was trying to exploit is that between the first field and the second field there are more than 1 space

Assign 2 spaces to FS then:

awk 'BEGIN{FS="  "}{print $1}' inputFile

I have done that with this awk 'BEGIN {FS= " ";} {print $1}'

(there are two spaces in there believe me) only it dosent work

No space after the equal sign
If under solaris try nawk

maybe I need to show the whole code im trying to get working

for name in $(zarafa-admin -l | awk 'BEGIN {FS = " ";} {print $1}')
do
zarafa-admin --details $name | egrep 'Username:*' | awk 'BEGIN {FS = " "}{print $1 $2}'
zarafa-admin --details $name | grep 'Current\ store\ size:*' | awk '{print $4}'
done

---------- Post updated at 09:23 AM ---------- Previous update was at 09:22 AM ----------

ahh - no space - let me try

/usr/xpg4/bin/awk -F" " '{
if (NR ==2)
{print $1 "       " $2}
}' filename

This code will give output as below
SYSTEM SYSTEM
quarantine quarantine
nigel Nigel
glennrosegarden Glenn
Rachel Sharpe
Sue Purkins
Anthony Anthony
Stephanie Crooke
Hannah Northern
Darren Maynot

still no good

---------- Post updated at 09:29 AM ---------- Previous update was at 09:27 AM ----------

the correct output should be

SYSTEM
quarantine
nigel
glennrosegarden
Rachel Sharpe
Sue Purkins
Anthony
Stephanie Crooke
Hannah Northern
Darren Maynot

Assigning two spaces to FS should work.
You may try this workaround though (convert all space to underscore, or any other unique character, assign this 2 new unique characters to FS, get the 1st field and convert unique character back to space)

sed 's/ /_/g' inputFile | awk 'BEGIN{FS="__"}{print $1}' | sed 's/_/ /g'

we are using Gentoo

 sed 's/  .*$//g' file

hi I really appreciate all your help guys

but im not really sure how where those SED commands fit into my script ?

can someone point me further ?

Did you try cabrao's command. That is looking for position where 2 spaces are there and deleting everything that position onwards. So output should be all characters before 2 spaces starts.
If it doesn't work, pls try following (check if there is some non-printable garbage character in file)
Please post what you get

head -2 inputFile | od -c

OR

head -2 inputFile | xd -c

head -2 is to test 1st 2 lines only.

by the way, your source file looks like an output of an sql statement :
If you have access to that statement, you could just

set head off
select username from yourusertable ;

instead of

select username, fullname from yourusertable;

the set head off is to get rid of the 2 header lines

that would be an elegant solution - however I have no idea of any of the tables behind it - the input is generated by our email system from the command

zarafa-admin -l

enter the command below and let us know what output you get:

file zarafa-admin

~ # file zarafa-admin
zarafa-admin: cannot open `zarafa-admin' (No such file or directory)

you should enter the full path : for example if
zarafa-admin is located in /opt/myapp/zarafa-admin

you should enter :

file /opt/myapp/zarafa-admin

so you should first find out the location of zarafa-admin by entering this :

find / -type f -name "zarafa-admin"

and wait until the command is finished

# file /usr/bin/zarafa-admin
/usr/bin/zarafa-admin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

---------- Post updated at 12:24 PM ---------- Previous update was at 12:23 PM ----------

thanks for being so patient and helping with this