10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using the following sed script to remove new lines (\r\n and \n), except from lines starting with >:
sed -i ':a /^>/!N;s/\r\n\(\)/\1/;s/\n\(\)/\1/;ta'
Is there a way to include both \r\n and \n in one regex to avoid the second substitute script (s/\n\(\)/\1/)? (4 Replies)
Discussion started by: Xterra
2. Shell Programming and Scripting
I want to get the word after the last '-' until the first dot
I have tried with regex lookbehind and lookahead like this:
but his returns too much
bb-cc-dd.ee.ff (7 Replies)
Discussion started by: chitech
3. UNIX for Advanced & Expert Users
I need some help with an awk command:
What I'm trying to do is append "MYGROUP: " to text with the substring "AT_"
the input file follows this format:
I want the output to be:
MYGROUP:... (2 Replies)
Discussion started by: bikecraft
4. Shell Programming and Scripting
I have a table like this
I want to know how many times the string in 2nd column appears in the first column as substring.
For example the first string of 2nd column "cgt" occurs 3 times in the 1st column and "acg" one time.
So my desired output is
THank you very much in advance:) (14 Replies)
Discussion started by: polsum
5. UNIX for Dummies Questions & Answers
I have a list that looks like this:
and there are 24 of these short words.
I am matching these patterns to another file with 755795 lines (file1.txt).
I have this code for matching:
awk -v f2=file2.txt '
while(... (2 Replies)
Discussion started by: heecha
6. UNIX for Dummies Questions & Answers
I am reading a file with millions of lines in it. Each line is big line containing several xml tags. I need to Output just the value of two tags in a seperate flat file.
For eg- I need to output whats present in <ComponentName> something </ComponentName> and another tag is... (2 Replies)
Discussion started by: sunnybehl
7. Shell Programming and Scripting
How to get the last 3 characters of a String irrespective of their length using awk?
Kinny (5 Replies)
Discussion started by: kinny
8. Shell Programming and Scripting
I am trying to get a substring from a string stored in a variable. I tried sed with a bit help from this forum, but not successful. Here is my problem.
My string is: "REPLYFILE=myfile.txt"
And I need: myfile.txt (everything after the = symbol).
My string is: "myfile.txt.gz.20091120.enc... (5 Replies)
Discussion started by: jamjam10k
9. UNIX for Dummies Questions & Answers
can we do substring fuctionality using AWK
say I have string "sandeep"
can i pick up only portion "nde" from it.
Thanks and Regards
Sandeep Ranade (3 Replies)
Discussion started by: mahabunta
10. Shell Programming and Scripting
Ok, I'm stumped and can't seem to find relevant info.
(I'm not even sure, I might have asked something similar before.):
I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
Discussion started by: ropers