so i have been trying to learn how to manipulate text on my own and have gotten stumped...

let's say i have a text file that says (highly simplified):

people ordinary

How would swap the order of the words..

I know i need to use sed and some kind of back reference but cannot make it work for the life of me..

thanks guys,

mary :eek: :mad: :eek: :o

Recommended Answers

All 2 Replies

sed -e 's/^\(.*\) \(.*\)$/\2 \1/g'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.