12-22-2010
I think this will work out for you, if the strings are of similar type( its just a workaround, as you must expect a much better solution from forum folks!):
str=`echo "PUT 810 712 0001 ILC AK4 00 0 00 00" | awk -F " " '{print $1","$2","$3","$4","$5","$6,$7,$8,$9,$10}'`
echo $str
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 REDHAT
pbm2ppa
pnm2ppa(5 Feb 2000) pnm2ppa(5 Feb 2000)
NAME
pbm2ppa - convert portable bitmap (PBM) to HP's Printing Performance Architecture (PPA) file format
SYNOPSIS
pbm2ppa [options] [ <infile] > [ <outfile]> ] ]
DESCRIPTION
Reads portable bitmap (PBM) format as input. Outputs a stream suitable for processing by Hewlett-Packard's range of Printing Performance
Architecture (PPA) printers. pnm2ppa supports the HP 710c, 712c, 720c, 722c, 820c, and 1000c series printers.
(Portable bitmap (PBM) format output can be produced from PostScript(tm) input by the GhostScript driver "pbmraw".)
OPTIONS
infile Input file infile is either a path to a file or device, or '-' to indicate stdin (defaults to stdin)
outfile
Output file outfile is either a path to a file or device, or '-' to indicate stdout (defaults to stdout)
-b bottommargin
Sets the bottom margin bottommargin in units of 1/600 inches (e.g., -b 150 = 0.25")
-d Displays the current configuration
-f configfile
Overrides reading the configuration from /etc/pnm2ppa.conf, and uses configfile instead.
-h Displays program usage
-l leftmargin
Sets the left margin leftmargin in units of 1/600 inches (e.g., -l 150 = 0.25")
-r rightmargin
Sets the right margin rightmargin in units of 1/600 inches (e.g., -r 150 = 0.25")
-s papersize
Sets the paper size. Possible values for papersize are a4 (A4), letter or us (US Letter, 8.5"x11"), and legal (US Legal, 8.5"x14").
The default is US Letter.
-t topmargin
Sets the top margin topmargin in units of 1/600 inches (ie -t 150 = 0.25")
-v printertype
Selects the printer model. Possible values of printertype are: 710, 712, 720, 722, 820 and 1000. The default is the HP DeskJet 7X0
Series (710, 712, 720, 722).
-x xoffset
Sets the x-offset xoffset from the left of the page. Units are 1/600 inches
-y yoffset
Sets the y-offset yoffset from the top of the page. Units are 1/600 inches
NOTES
The configuration file is read in first. Command line arguments then modify the resulting definitions.
The -x and -y options accumulate. The -v option resets all definitions back to an inbuilt default for that printer and should be used
before subsequent -b -l -r, -t, -x, and -y arguments.
SEE ALSO
pbm(5)
FILES
/etc/pbm2ppa.conf
Default configuration file
AUTHOR
This code is licensed under the GNU Public License version 2. See LICENSE for details.
(c) 1998 Tim Norman
HISTORY
This program was written by Tim Norman. It originally supported black and white output on the 820 series. This program is almost obsolete;
its successor pnm2ppa will support color printing.
BUGS
This is a stable driver, but does not support color printing.
pnm2ppa(5 Feb 2000)