12-22-2010
quick reply:
If you have a strings of similar types, then you can use something like:
HTML Code:
str=`echo "PUT 810 712 0001 ILC AK4 00 0 00 00" | sed 's/[ ]/,/5'`
echo $str
It will replace first 5 occurrences of space from left to right order!.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
please help in making sed singleline command
i need to insert dos new line (CR LF) before
" 34 matching device(s) found on \\cpu1."
" 6 matching device(s) found on \\cpu7."
" 102 matching device(s) found on \\mainserver."
the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Discussion started by: xserg
1 Replies
2. Shell Programming and Scripting
Hi,
how to replace new line with tab in sed ...
i used
sed -e 's/\n/\t/g' <filename >
but its not working (1 Reply)
Discussion started by: mail2sant
1 Replies
3. Shell Programming and Scripting
I have a large file that looks like the below output:
system SUNWxwmod X Window System kernel modules
system SUNWxwoft X Window System optional fonts
system SUNWxwopt X Window System Optional Clients
system ... (1 Reply)
Discussion started by: hxman
1 Replies
4. Shell Programming and Scripting
Hi !
I'm rather new with sed ... learned a lot already by googling etc ...
The following script should replace all spaces and ends-of-lines with "something (see below).
#!/bin/bash
i=0
while read line
do
fam="H`printf "%06d" $i`"
echo $line | sed -e 's//\t'$fam'\n/g'
i=$(($i+1))... (7 Replies)
Discussion started by: jossojjos
7 Replies
5. Shell Programming and Scripting
Input:
--------------------------
123asd 456sdasda 789a
-------------------------
output wanted:
---------------------
123asd
456sdasda
789a
----------------------
I want this by sed in simple way
please help (I know by: tr ' ' '\n' < inputfile )I want it by sed only (5 Replies)
Discussion started by: RahulJoshi
5 Replies
6. Shell Programming and Scripting
Hello everyone,
I want to replace all "," (commas) with a blank space
My command thus far is:
cat test.text | sed -e s/\`//g | awk '{print$1" "$2" "$3}'
I'm sure you guys know this, but the SED command that I am using is to get rid of the "`" (tics).
which gives me:
name ... (5 Replies)
Discussion started by: jayT
5 Replies
7. Shell Programming and Scripting
Hi,
i have below string -
mynameis arpit
i want output like below -
mynameis\ arpit
that i am getting from below -
temp='mynameis arpit'
echo $temp|sed 's//\\ /g' --> mynameis\ arpit
now i am doing - (2 Replies)
Discussion started by: thearpit
2 Replies
8. Shell Programming and Scripting
Dear All,
I am new here. Could anyone help to find a sed script for replace the third "," to " "?
input:
abc,def,ghi,jkl,mno,pqr,stu,vxz
output:
abc,def,ghi jkl,mno,pqr,stu,vxz
Many thanks.
Please use code tags next time for your code and data. (2 Replies)
Discussion started by: mimilaw
2 Replies
9. UNIX for Dummies Questions & Answers
`echo $file | sed 's/ / /g'`
Hey guys I want help in converting the spaces in my file names to '\ ' .
Example:
UK maps --> UK\ maps
Could someone please help me.
I have tried the following sequences already (none of them work):
1)s/ /\ /g
2)s/ /\\ /g
3)s/ /\\\ /g
Can someone... (7 Replies)
Discussion started by: INNSAV1
7 Replies
10. Shell Programming and Scripting
Hello
I have a requirement where I need to replace space :61 with !@ :61
Source
:60F:123 :61:151 :61:151 :61:15101
Target
:60F:123 :61:151!@:61:151!@:61:15101
I cant use and command as I don't want the tab to be converted .
commands not working :
sed 's/... (5 Replies)
Discussion started by: kamijia83
5 Replies
LEARN ABOUT DEBIAN
ppmfade
PPMFADE(1) General Commands Manual PPMFADE(1)
NAME
ppmfade - generate a transition between two image files using special effects.
SYNOPSIS
ppmfade [ -f first.ppm ] [ -l last.ppm ] [ -mix|-spread|-shift|-relief|-oil|-edge|-bentley|-block ] [ -base name ]
DESCRIPTION
This program generates a transition between either two input images or between one input image and black. You can use the 30 intermediate
images generated to show a smooth transition between segments of a movie. The input and output images are in the Portable Pixmap (PPM)
format. If you specify both input images, they should both be the same size. If you want to fade from black to an image, specify only the
last image. If you want to fade from an image to black, specify only the first image. ppmfade names the resulting image files base.nnnn
.ppm, where nnnn is a number varying between 0001 and 0030 and base is what you specify with via the -base option (default fade).
Another way to convert by steps from one image to another is morphing. You can use xmorph to do that.
OPTIONS
-f first.ppm
This is the image file (PPM format) to be used at the beginning of the transition. If not specified, the fade will start from
black.
-l last.ppm
This is the image file (PPM format) to be used at the ending of the transition. If not specified, the fade will end with black.
-mix The two images are superimposed with the brightness of the first image decreasing from full to none and the brightness of the final
image increasing from none to full. The transition is quadratic in brightness with faster transition in the beginning and slower at
the end.
-spread
The pixels in the first image will be moved (spread) further and further from their original location and then moved into the proper
location in the final image. This is the default transition.
-shift The pixels in the first image will be shifted further and further horizontally from their original location and then moved into the
proper location in the final image.
-relief
The first image is faded to a Laplacian relief filtered version of the first image. This is then faded to a Laplacian relief fil-
tered version of the second image and finally faded to the final image.
-oil The first image is faded to an "oil transfer" version of the first image. This is then faded to an "oil transfer" version of the
second image and finally faded to the final image.
-edge The first image is faded to an edge detected version of the first image. This is then faded to an edge detected version of the sec-
ond image and finally faded to the final image.
-bentley
The first image is faded to a "Bentley Effect" version of the first image. This is then faded to a "Bentley Effect" version of the
second image and finally faded to the final image.
-block The first image is defocused to small blocks. The small blocks are converted to match a defocused version of the last image. The
block version of the last image is then focused to the final image.
-basename
This forms part of the output filenames, as described above.
EXAMPLES
ppmfade -f teapot.ppm -l pyr.ppm
Fade from teapot.ppm to pyr.ppm generating fade.0001.ppm to fade.0030.ppm using the "spread" transition.
ppmfade -l teapot.ppm
Fade from black to teapot.ppm generating fade.0001.ppm to fade.0030.ppm.
ppmfade -f teapot.ppm -base end
Fade from teapot.ppm to black generating end.0001.ppm to end.0030.ppm.
SEE ALSO
tontsc(1), sgifade(1), smart_vfr(1), xmorph(1), ppm(5),
AUTHOR
Wesley C. Barris (wesb@msc.edu)
Army High Performance Computing Research Center (AHPCRC)
Minnesota Supercomputer Center, Inc.
1 April 1, 2000 PPMFADE(1)