Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvca!charles From: charles@hpcvca.CV.HP.COM (Charles Brown) Newsgroups: comp.sources.d Subject: Re: Column shifting Message-ID: <4310004@hpcvca.CV.HP.COM> Date: 27 May 89 01:02:54 GMT References: <68500002@sts> Organization: Hewlett-Packard Co., Corvallis, Oregon Lines: 14 > I'm wondering if there's been a program written that takes a file and > outputs that same file except with arbitrary columns shifted over. > Some examples are: > > input file is: 0123456789 > > Move column 7 to column 1: 0712345689 Try: sed -e "s/^\(.\)\(.....\)\(.\)/\1\3\2/" -- Charles Brown charles@cv.hp.com or charles%hpcvca@hplabs.hp.com or hplabs!hpcvca!charles or "Hey you!" Not representing my employer.