10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies
2. UNIX for Dummies Questions & Answers
I have a log file which lists groups and users in the following format
GROUP1
user1
user2
user3
GROUP2
user4
user5
user6
GROUP3
user7
user8
I need to change the format to:
user1|GROUP1
user2|GROUP1
user3|GROUP1
user4|GROUP2 (3 Replies)
Discussion started by: Angela S
3 Replies
3. Shell Programming and Scripting
I would like to search for strings stored in searchstringfile.txt in inputfiles.
searchstringfile.txt
J./F.
Gls. Wal
F.
Towerinput1.txt
What is needed is J./F. 12 var Gls. Wal 16 interp. Tower 12 input2.txt
Awk shall search for F. 16 pt. J./F. 22 output.txt
input1.txt J./F. = 12 var... (3 Replies)
Discussion started by: sdf
3 Replies
4. Shell Programming and Scripting
I am wanting to take a list of strings and loop through a list of textfiles to find matches. Preferably with awk and parsing the search strings into an array.
// Search_strings.txt
tag
string
dummy
stuff
things
// List of files to search in
textfile1.txt
textfile2.txt
The... (6 Replies)
Discussion started by: sdf
6 Replies
5. Shell Programming and Scripting
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies
6. Shell Programming and Scripting
What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info.
Basically my file looks like this:
...... (6 Replies)
Discussion started by: Mbohmer
6 Replies
7. Shell Programming and Scripting
If i wanted to search for two strings that are on lines in the log, how do I do it?
The following code searches for just one string that is one one line.
awk '/^/ {split($2,s,",");a=$1 FS s} /failure agaf@fafa/ {b=a} END{print b}' urfile
What if I wanted to search for "failure agaf@fafa"... (3 Replies)
Discussion started by: SkySmart
3 Replies
8. Shell Programming and Scripting
Thank you for assisting,
I've got a partial solution just needs a tweak.
Hulk-BASH$ cat somefile.txt
oh there is some stuff here
some more stuff here
START_LABEL
stuff I want
more stuff I want
END_LABEL
other stuff here too
and even more stuff here too
Hulk-BASH$
Hulk-BASH$ sed... (8 Replies)
Discussion started by: laser
8 Replies
9. Shell Programming and Scripting
Hi experts,
You cool guys already given me the awk script below-
awk '/9366109380/,printed==5 { ++printed; print; }' 2008-09-14.0.log
Morever, i have one more things-
when i awk 9366109380, i can also see the Upper 3 lines as well as below 5 lines of that string.
Line 1.... (3 Replies)
Discussion started by: thepurple
3 Replies
10. Shell Programming and Scripting
Hi All,
I have files:
1. abc.sql
'This is a sample file for testing'
This does not have quotations
this also does not have quotations.
and this 'has quotations'.
here I need to list the hard coded strings 'This is a sample file for testing' and
'has quotations'.
So i have... (13 Replies)
Discussion started by: kprattip
13 Replies