10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a file abc.txt which has records like
456 /home/fgg/abdc.txt
3567 /home/fdss/vfgb.txt
23 /home/asd/dfght.txt
I WANT TO REMOVE STRING UNTIL 3RD OCCURANCE OF FORWARD SLASH
Output should be like
abdc.txt
vfgb.txt
dfght.txt (5 Replies)
Discussion started by: himanshupant
5 Replies
2. UNIX for Beginners Questions & Answers
Hi All,
From the below file. I need to get only the first occurrence and print. I tried to do it in separate grep not coming as expected
Original file
11001;1213;304;;;;;;;111020677.64;;;;;;;;;;;;;;;;;;;;;;;;;;
11001;1214;304;;;;;;;102376462.96;;;;;;;;;;;;;;;;;;;;;;;;;;... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
3. Shell Programming and Scripting
I need to extract multiple occurance strings between 2 different patterns in given line.
For e.g. in below as input
-------------------------------------------------------------------------------------
mike(hussey) AND mike(donald) AND mike(ryan) AND mike(johnson)... (8 Replies)
Discussion started by: sameermohite
8 Replies
4. Shell Programming and Scripting
I want to replace every 2nd occurance of a string/character from a line.
ababacbsbddbsbbcbdbssb
i want to replace every s2nd b with @ like below
should be like
aba@acbs@ddbs@bc@dbss@ (3 Replies)
Discussion started by: ratheeshjulk
3 Replies
5. Shell Programming and Scripting
I have text file as follows and would like to remove the last occurance of "UNION ALL" string and replace @@ with single quote (').
Input text in file is
with temp as (
( select ----------- where OPERATION = @@B@@ and OBJECTTYPE = @@P@@ and start_time desc ) UNION ALL
( select... (9 Replies)
Discussion started by: Vaddadi
9 Replies
6. Shell Programming and Scripting
Hi,
I'm trying to match records using awk which contain only one occurance of my string, I know how to match one or more (+) but matching only one is eluding me without developing some convoluted bit of code. I was hoping there would be some simple pattern matching thing similar to '+' but... (9 Replies)
Discussion started by: jonathanm
9 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am new to Unix world. Is there any command which can directly return the second occurance of a particular string in a file? Basically, I want to read the contents of the file from the second occurance of a particualr string. Can be implemented using a loop, but am just wondering if there... (5 Replies)
Discussion started by: saurabhsinha23
5 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I file that has all the status for one day (24hours). Now what I want to do is to count the occurence of a string in its output hourly like for example count occurance of successful or asynchronous clear destinon for every hour and redirect it to file. Please see sample file below. Please... (2 Replies)
Discussion started by: ayhanne
2 Replies
9. Shell Programming and Scripting
Hi All,
I have an awk code below. How can i edit it such that once it finds the term "start" , it will extract all the rest of data thereafter ?
awk '/start/, /stop/' file (4 Replies)
Discussion started by: Raynon
4 Replies
10. Shell Programming and Scripting
I have a small query. I have a file containing the following lines
abcd<12></12>fdfgdf<12>sdfgfg<12>
sdfsdf<12></12>ytunfg<12>
hggfhf<12>rtysb<12>zdfgdfg<12>
Now I wish to delete ONLY the last occurance of string <12> from every lines of code. That mease my final output will be like this:... (7 Replies)
Discussion started by: dkhanna01
7 Replies