sort columns in text file

need to sort the following txt file on the second column.
sort +1 -2 body.txt did not work, nor did sort -k 35,50 body.txt nor did sort -t\t +1 -2 body.txt

Oracle Programming                 Sunderraman      in                
Unix for Programmers and Users     Glass            in                
Java Programming                   King             out   10/12/99    Smith
C Programming                      King             out   4/1/10      Jackson
Database Systems                   ElMasri          out   12/5/99     Jones
Discrete Math                      Jackson          in                
Extreme Intelligence               Jackson          in  

the first field is 35 chars, second is 15 chars.

thanks
jjackson2004Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bryan ButlerCommented:
This worked for me:

> Sort -k 35,50 body.txt
C Programming                      King             out   4/1/10      Jackson
Database Systems                   ElMasri          out   12/5/99     Jones
Discrete Math                      Jackson          in
Extreme Intelligence               Jackson          in
Java Programming                   King             out   10/12/99    Smith
Oracle Programming                 Sunderraman      in
Unix for Programmers and Users     Glass            in

0
Bryan ButlerCommented:
What error or output did you get?
0
jjackson2004Author Commented:
no error, it just would not sort on anything other than the beginning of the line.
0
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

shajithchandranCommented:
Try sort -t: -k1.35b body.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shajithchandranCommented:
it would be good if while generating the this file, separate field with | rather than space. That way it would be easy to sort it.
0
shajithchandranCommented:
i just changed the field separator to : which doesnt exist in the line.. so the whole line becomes the first field. Than i sorted it based on the 35character to get sort based on the field that you were interested in.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.