![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| More than transposing! | bulash | UNIX Desktop for Dummies Questions & Answers | 3 | 04-11-2008 05:20 PM |
| Transposing string | unibboy | Shell Programming and Scripting | 3 | 02-13-2008 06:12 PM |
| Major Awk problems (Searching, If statements, transposing etc.) | Blivo | Shell Programming and Scripting | 2 | 09-05-2007 06:41 AM |
| Another transposing issue | stevesmith | Shell Programming and Scripting | 14 | 09-16-2006 04:48 AM |
| file transposing | mskcc | Shell Programming and Scripting | 24 | 08-04-2005 11:23 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
transposing letters
Hi, I've written a shell function in bash that reads letters into an array, then outputs them in one column with:
for n in "${array[@]}"; do echo $n done I was wondering if anyone knew how i would transpose the letters that are output by the for loop. Right now my output is: aabbcc ddeeff gghhii ex...if I input 'aabbcc ddeeff gghhii' into the array, is it possible to transpose them and output: ccbbaa ffeedd iihhgg can i use sed? thanks. |
|
||||
|
I would use rev, but i don't want to reverse the whole string...
say the input is xxyyzz, i want to keep 3 pairs of 2, and swap the xx and the zz, keep the yy in the same place, and keep the characters in the same order within their pairs...another example, say i have 123456, it would be output as 563412. thanks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|