03-13-2009
Print a horizontal word vertically.
Say I have the word:
zinger
I want to change it to print
z
i
n
g
e
r
This is for a sorting algorithm that I am testing out. I will then use sort on the vertical and change it back to horizontal printing using tr. Once it is horizontal again, I can compare that sorted jumble against a dictionary doing the same munging. It should give me all the words that use the same letters with the same frequency.
Unfortunately, I am having a brain fart and can't figure out how to get sed to convert this from horizontal to vertical.
I tried this:
sed -e 's/(.)/\1\n/g'
but it doesn't work. It says that my back reference on the right hand side is wrong.
Any help would be appreciated.
Jim
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
1) I had one query regarding how to define a particular value which has a space.
For example, I would say
for i in s su sur
do
print $i
sleep 1
done
This will results in
s
su
sur
Now I want... (0 Replies)
Discussion started by: ss_psm
0 Replies
2. Shell Programming and Scripting
i have a file in this pattern
MATCH1 word1 IMAGE word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH1 word1 IMAGE word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1... (7 Replies)
Discussion started by: bangaram
7 Replies
3. UNIX for Dummies Questions & Answers
Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name".
Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have gone through may posts and dint find exact solution for my requirement.
I have file which consists below data and same file have lot of other data.
<MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'>
<MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies
5. Shell Programming and Scripting
Hi
can we grep for a word and print the next word of the greped word?
ex:- create or replace function function_name
create function function_name
we should search for word "function" and output next word "function_name" from both lines. (3 Replies)
Discussion started by: manasa_vs
3 Replies
6. Shell Programming and Scripting
hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this:
I have in my response lines like:
<div class="sender">mimi020</div>
<some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies
7. Shell Programming and Scripting
Hi AWK Experts,
Following is the data :
BRH113 DD AA HH CA DD DD AA HH BRH091 A4 A6 AH H7 67 HH J8 9J BRH0991 AA D8 C23 V5 H7 BR2 BRH991 AA HH GG5 BT0 JJ0
I want the output to be alligned with the pattern matching "BRH" inthe line.
The output should be look like:
A]... (4 Replies)
Discussion started by: rveri
4 Replies
8. Shell Programming and Scripting
Hi,
I am trying to search for a word and print the next word. For example:
My text is "<TRANSFORMATION TYPE ="Lookup Procedure">"
I am searching for "TYPE" and trying to print ="Lookup Procedure"
I have written a code like following:
echo $line | nawk... (4 Replies)
Discussion started by: sampoorna
4 Replies
9. Shell Programming and Scripting
Hi,
I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file.
Ex:
$ cat "sample.log"
I am searching for a word which is present in this file
We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
10. UNIX for Dummies Questions & Answers
Hi Masters,
I need help to change my vertical data to horisontal
input
2015-04-13|JS|741667
2015-04-13|JSJ|2272
2015-04-13|TMS|107099
2015-04-12|JMD|47945
2015-04-13|TM|760024
2015-04-13|JM|484508
2015-04-14|JMJ|318
2015-04-14|JSD|54436
2015-04-13|JM|15410
Output... (2 Replies)
Discussion started by: radius
2 Replies
CGlue(3U) InterViews Reference Manual CGlue(3U)
NAME
CGlue - connector glue
SYNOPSIS
#include <Unidraw/cglue.h>
DESCRIPTION
CGlue defines a natural size, elasticity (its rate of stretching and shrinking relative to other CGlue), and deformation limits (total
amount it can stretch and shrink) in both the horizontal and vertical dimensions. CGlue can be interposed between two connected connectors
to augment their connectivity semantics; it acts like two non-linear springs, one horizontal and one vertical, connecting the connectors'
centers.
PUBLIC OPERATIONS
CGlue(
float hnat = 0, float vnat = 0,
float hshr = 0, float hstr = 0,
float vshr = 0, float vstr = 0,
float hshrlim = 0, float hstrlim = 0,
float vshrlim = 0, float vstrlim = 0
)
CGlue(const Shape&)
Instantiate CGlue, providing the requisite parameters explicitly or inferring them from a Shape object. If a shape is supplied,
then the CGlue adopts the shape's natural size, and it assigns the shape's stretchability and shrinkability values to its corre-
sponding CGlue elasticity members to obtain a proportionately equivalent elasticity. It also assigns the shape's stretchability and
shrinkability values to its deformation limit members. The parameters are described below:
hnat, vnat: horizontal and vertical natural sizes, screen units
hshr, vshr: horizontal and vertical shrinking rate, constant units
hstr, vstr: horizontal and vertical stretching rate, constant units
hshrlim, vshrlim: horizontal and vertical shrink limit, screen units
hstrlim, vstrlim: horizontal and vertical stretch limit, screen units
CGlue* Copy()
Create a copy of this CGlue instance.
void Rigid()
Set all elasticity and deformation limits equal to zero.
void Interpose(const CGlue* glue)
Change this instance's attributes to reflect the series combination of this and glue.
SEE ALSO
Connector(3U), Shape(3I)
Unidraw 23 November 1990 CGlue(3U)