10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi Team,
I have data like this.
|*|.5|*|0.2|*|A.B|*|
Would like to add zero (0) before the decimal point where there is no zero as
|*|0.5|*|0.2|*|A.B|*|
How to replace |*|. with |*|0.
I tried below command which didn't work
echo '|*|.5|*|0.2|*|A.B|*' | sed... (4 Replies)
Discussion started by: Ravi.K
4 Replies
2. Shell Programming and Scripting
Hi Unix Guru,
I have an requirement for replace some specail characters in a file, my file came from mainframe.
please see below example:
when open it with vi
17896660|89059215|04/24/1998 00:00:00.000000| abc 123-453-1312^M<85>^M<85>|124557
if I run cat -v I got following:... (25 Replies)
Discussion started by: ken002
25 Replies
3. Shell Programming and Scripting
I would like to replace /n with ',' and after replace remove last semicolon then put a open brace in starting and closing brace in end of line. See below example:
input:
1234
3455
24334
234
output:
('1234,'3455',24334','234')
Thanks (3 Replies)
Discussion started by: anupdas
3 Replies
4. Shell Programming and Scripting
i need to replace the any special characters with escape characters like below.
test!=123-> test\!\=123
!@#$%^&*()-= to be replaced by
\!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies
5. Shell Programming and Scripting
I have a line ending with special character and 0
The special character is the field separator for this line
in VI mode the file will look like below, but while cat the special character wont display
i know the hexa code for the special character ^_ is \x1f and ascii code is
\0037,
... (0 Replies)
Discussion started by: ratheeshjulk
0 Replies
6. Solaris
Hi ,
I want to replace the special characters in the file.
For eg: cat abc
1234/4455/acb
234/k/lll/
234`fs`fd
I want to replace / and ` with the letter a and the output should like below. How to achieve this.
1234a4455aacb
234akallla
234afsafd (2 Replies)
Discussion started by: rogerben
2 Replies
7. Shell Programming and Scripting
Hi everyone
I have file1 contains:
'7832'
' 8765
6543
I want a sed command that will format as:
'7832' , '8765' , '6543'
I tried
sed -e s/\'//g -e 's/^*//;s/*$//' file1 > file2
sed -e :a -e '$!N; s/\n/ /; ta' file2
which gives: 7832 8765 6543
I need some help to continue with... (5 Replies)
Discussion started by: nimo
5 Replies
8. Shell Programming and Scripting
I have a shell script that I have written to be a kind of to-do/notepad that's quickly executable from the command line. However, special characters tend to break it pretty well.
Ie: "notes -a This is an entry." works fine.
"notes -a This is (my) entry." will toss back a bash syntax error on... (5 Replies)
Discussion started by: skylersee
5 Replies
9. Shell Programming and Scripting
Hi All,
I have a requirement to read a line from a file with some search string, replace any backslash characters in that line and store in a variable.
Shell script: replace.ksh
#!/bin/bash
file2=input.rtf
line=`grep "Invoice Number" ${file2} | head -1 | sed 's/\\//g'`
echo "start... (6 Replies)
Discussion started by: prashas_d
6 Replies
10. Shell Programming and Scripting
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies