I am searching while I await a response to this so if it has been asked already I apologize.
I have a file with lines in it that look like:
bob johnson email@email.org
I need it to look like:
bob:johnson:email@email.org
I am trying to use sed like this:
sed -e 's/ /:/g' file >... (5 Replies)
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)
SHELL SCRIPT
Hi
I have a file in the following format
Mayank Sushant
Dheeraj Kunal
ARUN Samir
How can i replace the white space in between and replace them with a comma?? The resultant output should be
Mayank,Sushant
Dheeraj,Kunal
ARUN,Samir
i tried using
sed -e... (8 Replies)
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)
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)
Hi
I have written a shell script which used sed code below
sed -i 's/'"$Pattern"'/ /g' $FileName
I want to count the length of Pattern and replace it with equal number of spaces in the FileName.
I have used $(#pattern) to get the length but could not understand how to replace... (8 Replies)
`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)
I've got a sed shell script I've been using for quite a while to do batch find/replace operations on .xml files containing various types of text entries. This is the script I use:
#!/bin/bash
while read text_old text_new; do
sed_script+="s/$text_old/$text_new/g;"
done < trans_old_to_new... (9 Replies)
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 HPUX
unexpand
expand(1) General Commands Manual expand(1)NAME
expand, unexpand - expand tabs to spaces, and vice versa
SYNOPSIS
tablist] [file ...]
tablist] [file ...]
Obsolescent:
tabstop] tabn] [file ...]
DESCRIPTION
processes the named files or the standard input and writes to the standard output with tabs changed into spaces. Backspace characters are
preserved in the output, and the column count is decreased by one column for tab calculations. For proper tab calculation, if a multi-col-
umn character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column width. If a tab
character is found after the last tab position, it is replaced by a single space. is useful for preprocessing character files that contain
tabs (before sorting, looking at specific columns, etc).
recognizes the following command-line options and arguments:
tablist specifies where to set the tab positions instead of the default tablist can take two forms. If it is a single num-
ber, tabs are set tablist spaces apart. tablist can also be a blank- or comma-separated list of increasing positions
where tabs are to be set.
This option is obsolescent and is equivalent to using
This option is obsolescent and is equivalent to using
processes the named files or the standard input and writes to the standard output with spaces changed into tabs where possible. By
default, only leading spaces and tabs are converted to maximal strings of tabs. The default tab position is every 8 characters. Backspace
characters are preserved into the output, and the column count is decreased by one column for tab calculations. For proper tab calcula-
tion, if a multi-column character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column
width.
recognizes the following command-line options and arguments:
Tabs are inserted whenever they would compress the resultant file
by replacing two or more spaces before a tab position.
tablist specifies the tab positions. tablist can take two forms. If it is a single number, tabs are set every tablist spa-
ces apart. If tablist is a blank- or comma-separated list of increasing positions, tabs are set at those locations.
The option implies the option. If the option is not specified, the default is equivalent to specifying except that
is not implied for this case.
EXTERNAL INFLUENCES
Environment Variables
determines the interpretation of text as single and/or multi-byte characters.
determines the language in which messages are displayed.
If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of
If any internationalization variable contains an invalid setting, and behave as if all internationalization variables are set to "C". See
environ(5).
If is set to a non-empty string value, it overrides the values of all the other internationalization variables.
International Code Set Support
Single- and multi-byte character code sets are supported with the exception that do not recognize multi-byte alternative space characters.
STANDARDS CONFORMANCE expand(1)