10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
First of all, apologies if this has already been answered elsewhere. I haven't quite been able to find what I'm looking for yet, so hopefully this won't come across as repetition.
I have a file consisting of ~100 nearly identical lines, each of which contains multiple instances of the string I... (11 Replies)
Discussion started by: pseudo.seppuku
11 Replies
2. Shell Programming and Scripting
I have a file: file.txt, which contains the following data in it.
This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt
My name is not Karl, my name is Karl Joey
What is your name?
Do you know your name and... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies
3. UNIX for Advanced & Expert Users
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies
4. Shell Programming and Scripting
i have a script that scans a log file every 10 minutes. this script remembers the last line of the log and then uses it to continue monitoring the log when it runs again 10 minutes later.
the script searches the log for a string called MaxClients.
now, how can i make it so that when the... (7 Replies)
Discussion started by: SkySmart
7 Replies
5. Shell Programming and Scripting
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies
6. Shell Programming and Scripting
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies
7. Emergency UNIX and Linux Support
Hello,
I have a 100 line code. I have given a sample of it below:
ABC*654654*1*54.54*21.2*87*1*654654654654
CCC*FS*FS*SFD*DSF
GGG*FGH*CGB*FBDFG*FGDG
ABC*654654*1*57.84*45.4*88*2*6546546545
CCC*WSF*SG*FGH*GHJ
ADA*AF*SFG*DFGH*FGH*FGTH
I need to select the line starting with "ABC" its... (3 Replies)
Discussion started by: nithins007
3 Replies
8. Shell Programming and Scripting
Hello,
I have a 100 line code. I have given a sample of it below:
ABC*654654*1*54.54*21.2*87*1*654654654654
CCC*FS*FS*SFD*DSF
GGG*FGH*CGB*FBDFG*FGDG
ABC*654654*1*57.84*45.4*88*2*6546546545
CCC*WSF*SG*FGH*GHJ
ADA*AF*SFG*DFGH*FGH*FGTH
I need to select the line starting with "ABC" its... (6 Replies)
Discussion started by: nithins007
6 Replies
9. Shell Programming and Scripting
Hi,
I want find multiple string in one file using find coomand.
And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies
10. Shell Programming and Scripting
Hi,
I am stuck with pattern matching.
I need to match a particular pattern several times in a same line and replace them.
for ex.,
I need to convert
(abc XY) (bvf ZY) bla bla
to
XY ZY bla bla
I tried..
s/\(+ (.+)\)/$1/gi
and it works (2 Replies)
Discussion started by: oldtrash
2 Replies