10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I am looking for to filter out based on 7th character and list the number of occurrence based on the 7th character if p , d , o or m
1. if 7th character is p , Output should be: p_hosts = N
2. if 7th character is d , Output should be: d_hosts = N
3. if 7th character is o , Output... (10 Replies)
Discussion started by: rveri
10 Replies
2. 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
3. UNIX for Dummies Questions & Answers
Hi,
let's say an input looks like:
A|C|C|D
A|C|I|E
A|B|I|C
A|T|I|B
as the title of the thread explains, I am trying to get something like:
1|A=4
2|C=2|B=1|T=1
3|I=3|C=1
4|D=1|E=1|C=1|B=1
i.e. a count of every character in each field (first column of output) independently, sorted... (4 Replies)
Discussion started by: beca123456
4 Replies
4. UNIX for Dummies Questions & Answers
hey guys, i have been trying to work this thing out with sed with no luck :confused:
i m looking for a way to replace only the first occurrence after a match
for example :
Cat
Realized what you gotta do
Dog
Realized what you gotta do
Sheep
Realized what you gotta do
Wolf
Realized... (6 Replies)
Discussion started by: boaz733
6 Replies
5. Shell Programming and Scripting
Hello
how to find last occurence of a string
for example in the following I want last occurence of '-' i.e. position 12
str="aa-bbb-cccc-ddd-ee"
my pupose is to get the string 'ee'
Thanks and Regards
Chetanz (5 Replies)
Discussion started by: Chetanz
5 Replies
6. Shell Programming and Scripting
Hi
I need help on this ..!!
Input :
xx_abc_regA
xx_def_regB
xx_qwe_regC
Now i required the output as the below
abc
def
qwe
Need to remove last occurrence of character (_) and rest of the string in Unix (sed).
Thanks in Advance ..!!!
-Nallachand (3 Replies)
Discussion started by: Nallachand
3 Replies
7. Shell Programming and Scripting
Hi, I am totally new to shell scripting.
I have a String "c:\working\html\index.txt.12-12-2009.bkp" I want to check if the string has more than one "." character. If it does I would like to retrieve only "c:\working\html\index.txt" i.e, discard the second occurrence of "." and the rest of the... (7 Replies)
Discussion started by: imr
7 Replies
8. Shell Programming and Scripting
hi all,
I have a text file with following content
PAGENUMBER
asasasa
asasasa
PAGENUMBER
sasasasasa
PAGENUMBER
using sed i want to replace PAGENUMBER by occurrence count
eg
1
asasasa
asasasa
2
sasasasasa
3 (4 Replies)
Discussion started by: uttamhoode
4 Replies
9. Shell Programming and Scripting
HPUX /bin/sh (posix)
I have a file as such
cat dog mouse
deer elk rabbit
mouse rat pig
I would like to replace the second occurrence of mouse in this file with mouse2. The rest of the file has to stay exactly as is. I'm not sure exactly where mouse might be (could be first,second,third... (5 Replies)
Discussion started by: lyoncc
5 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I have a very large; delimited file. In vi I would like to replace:
CSACT_DY;AVG_UEACT1;uesPerActiveLinkSetSize_1;#;A
CSACT_DY;AVG_UEACT2;uesPerActiveLinkSetSize_2;#;A
CSACT_DY;AVG_UEACT3;uesPerActiveLinkSetSize_3;#;A
with:
CSACT_DY;AVG_UEACT1;Average... (7 Replies)
Discussion started by: gilmord
7 Replies