10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
"1"|"ExternalClassDEA519CF5"|"Art1"
"2"|"ExternalClass563EA516C"|"Art3"
"3"|"ExternalClass305ED16B8"|"Art9"
...
...
... (2 Replies)
Discussion started by: fspalero
2 Replies
2. Shell Programming and Scripting
Hi,
Searching through forum I found "sed 's/*$//'" can be used to remove trailing whitespaces and tabs from file. The command works fine but I see minor issue as below. Can you please suggest if I am doing something wrong here.
$ cat a.txt
upg_prod_test
upg_prod_new
$ cat a.txt |sed... (11 Replies)
Discussion started by: bhupinder08
11 Replies
3. Shell Programming and Scripting
Hi,
I have a file that has data something like below:
A
B
C
D
.....
......
.....and so on
I am trying to bring it in one line with comma delimited something like below :
A,B,C,D
I tried the something below in the code section:
cat File.txt | tr '\n' ',' (1 Reply)
Discussion started by: rkumar28
1 Replies
4. UNIX for Dummies Questions & Answers
I need help removing the last character of every line if it is a certain character. For example I need to get rid of a % character if it is in the last position.
Input:
aaa%
%bbb
ccc
d%dd%
Output should be:
aaa
%bbb
ccc
d%dd
I tried this but it gets rid of all of the % characters.... (5 Replies)
Discussion started by: raptor25
5 Replies
5. UNIX for Dummies Questions & Answers
I need to remove square brackets from output of script.
Output is:
and I need to remove the square brackets so I am lett with
121 Is sed the only means to do this and if so what are the options?
...ok so far I have managed to get rid of ] by using /usr/bin/sed 's/]//' but that... (5 Replies)
Discussion started by: rob171171
5 Replies
6. Shell Programming and Scripting
I have a file like this:
DDD_ABCDE2AB2_1104081408.104480
I need to remove the 1 after the . in the file name so that it reads:
DDD_ABCDE2AB2_1104081408.04480
Having some difficulty getting the command to work. I tried using
cut -d 26
but that just doesn't work. (3 Replies)
Discussion started by: bbbngowc
3 Replies
7. Shell Programming and Scripting
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Discussion started by: mohullah
5 Replies
8. Shell Programming and Scripting
Hi All,
I'm trying to write a ksh script to parse a file. When the "\" character is encountered, it should be removed and the next line should be concatenated with the current line. For example...
this is a test
line #1\
should be concatenated with line #2\
and line number 3
when this... (3 Replies)
Discussion started by: newbie_coder
3 Replies
9. Shell Programming and Scripting
HI All,
Have some files which contains some string like,
"create .<table1> as"
"insert into .<table2> values",
i want to replace ".<table1>" with only "<table1>", i.e removing '.' character in ksh, i have written below code but it is not removing the dot character, any help?
for name... (2 Replies)
Discussion started by: arvindcgi
2 Replies
10. UNIX for Dummies Questions & Answers
Hello,
I am attempting to remove all the ^M characters in a file in VI.
The command I am using is
:1,$s/^V^M//g
but it doesn't work, saying 'substitute pattern match failed'.
Any ideas why?
Jules (2 Replies)
Discussion started by: julesinbath
2 Replies