10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)
Discussion started by: cmccabe
0 Replies
2. Shell Programming and Scripting
Hi experts,
I have a file with regexes which is used for automatic searches on several files (40+ GB).
To do some postprocessing with the grep result I need the matching line as well as the match itself.
I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Discussion started by: stresing
2 Replies
3. Shell Programming and Scripting
(5 Replies)
Discussion started by: radioactive9
5 Replies
4. Shell Programming and Scripting
Good day,
I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after.
file1:
file2:
Output:
I can match a regex and print the line and line after
awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } '
... (1 Reply)
Discussion started by: pathunkathunk
1 Replies
5. Shell Programming and Scripting
Hi guys, I'm new to bash programming, so please pardon me.
I'm trying to replace an entry's text in Books.txt
This code works perfectly:
sed -i "s/$BookTitle/$NewBookTitle/g" Books.txt
But problem is, if there are double entries, it will also replace that entry. For example:
... (12 Replies)
Discussion started by: todaealas
12 Replies
6. Shell Programming and Scripting
Hi,
I have a text file which is output from a server and it lists all the files in a specific volume. However, the volume name appears as volume_name:.
I would like to replace this with \\volume_name\volume_name. This is not a problem in itself as I can use sed to globally look for the... (8 Replies)
Discussion started by: vnayak
8 Replies
7. Shell Programming and Scripting
Hi,
I know there are lots of threads on replacing text within files, usually using sed or awk. However, I find it hard to adapt examples that I found to my specific case. I am kind of new to UNIX and have hard times learning the syntax either for sed or awk so I would appreciate any help. Here's... (5 Replies)
Discussion started by: vytenis
5 Replies
8. UNIX for Dummies Questions & Answers
hi,
i currently have a file with columns similar to this
customer name owed
CID123 John 300
CID342 harry 500
at present i use use awk to find the amount owed by the customer using the customer ID (CID).
if the customer spends more money how would i go about using sed/awk etc to... (2 Replies)
Discussion started by: skinnygav
2 Replies
9. Shell Programming and Scripting
Hello,
I would like to delete all the footnotes in all my htm files. Hence, I have to delete the whole font tag pairs, i.e. deleting everything between the begin/end font tags.
I create a testfile, of which data parts of all four lines are the same except for the number of font tag pairs,... (3 Replies)
Discussion started by: cibalo
3 Replies
10. Shell Programming and Scripting
I am attempting to convert rewrite rules to Nginx, and since due to the mass amount of rewrites we must convert, I've been trying to write a script to help me on a specific part, easily.
So far I have this:
rewrite ^action/static/(+)/$ staticPage.php?pg=$1&%$query_string;
What I want done... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies