Article View: comp.sources.d
Article #5019Re: Column shifting
From: roy
Date: Fri, 19 May 1989 17:47
Date: Fri, 19 May 1989 17:47
31 lines
1702 bytes
1702 bytes
/* Written 10:45 am May 19, 1989 by roy@sts.sts.UUCP in sts:comp.sources.d */
/* ---------- "Column shifting" ---------- */
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
Move column 7 to column 1, column 3 to column 5: 0712453689
Move column 7 to column 1, column 3 to column 8: 0712456839
This sounds a bit like the bubble sort, so I think it probably exists.
Just out of curiosity, are there any other algorithms out there?
Thanks.
/* End of text from sts:comp.sources.d */
Somebody just suggested using the "cut" command of SysV as the
solution to this. I read the documentation and it looks like it
merely deletes certain columns or fields, but does not move them as I
wished. Am I wrong about "cut"? Any other ideas?
==================================================================
Roy Bixler | UUCP: ...!{claris,sun}!sts!roy |
Semiconductor Test Solutions | Internet: sts!roy@Claris.COM |
4101 Burton Dr. | phones: (408) 727-2885 x132 (work)|
Santa Clara, CA 95054 | (408) 289-1035 (home)|
==================================================================
Technical Details
Message-ID:
<68500004@sts>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!claris!sts!royReferences:
<68500002@sts>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!claris!sts!roy From: roy@sts.sts.UUCP Newsgroups: comp.sources.d Subject: Re: Column shifting Message-ID: <68500004@sts> Date: 19 May 89 17:47:00 GMT References: <68500002@sts> Lines: 31 Nf-ID: #R:sts:68500002:sts:68500004:000:1308 Nf-From: sts.sts.UUCP!roy May 19 10:47:00 1989