|
I know the question is very subjective. But I cannot form the question in a much more better manner. I would appreciate some guidance.
I often as a developer feel how easier it would have been for me if I could have some tools for doing some reasonably...
Started by ajay on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
As suggested by ikkebr, python is probably as good for the modules... .
I would use Perl over a bash/sed/awk/sed, I usually end up using perl instead.
With it - if I was to start again, I'd learn python instead I think .
|
|
Let's say I have something like this (this is only an example, actual request will be different: I loaded StackOverflow with LiveHTTPHeaders enabled to have some samples to work on):
http://stackoverflow.com/ GET / HTTP/1.1 Host: stackoverflow.com User...
Started by Tim on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Equivalent....
$ sed -e 's/^\s*$//' livehttp.txt | \ perl -e '$/ = ""; while (<>, but sed can clean those up.
Gm; print; }
I consider using sed and perl in the same pipeline to be a little bit trailing whitespace issues.
|
|
I have an input file say, such as:
a=1 b=2 c=3 d=4 a=2 b=3 a=0 c=7 a=3 b=9 c=0 d=5 a=4 d=1 c=9
Assume that the order of column names (a,b, c and d) remains the same. How do I write a script/ command which will help me extract values specific to columns...
Started by Sumit on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
I like how short the sed / perl solution is -- but how easily can it be modified to takeSed will do it pretty nicely:
sed -e 's/[^bd]=[^ ]*//g' -e 's/^ *//' -e 's/ *$//' < filename-liner version:
$ perl -lpe '@x....
Field2.
|
Ask your Facebook Friends
|
Hello,
just want to know what are the main differences among them? and the power of each language (where it's better to use it).
Edit: it's not "vs." like topic, just information.
Started by Khaled Al Hourani on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Two of the programs provided....
Perl was written in part as an awk-killer and sed-killer.
The sed program is a stream editor, and is designed to apply the actions into fields automatically.
awk , perl , python .
|
|
I want to extract the URL from within the anchor tags of an html file. This needs to be done in BASH using SED/AWK. No perl please.
What is the easiest way to do this?
Thanks a lot.
Started by codaddict on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
OT: The sed website has a lot of good information and many interesting....
Believe it or not, someone has already done this.
An example, since you didn't provide any sample
awk 'BEGIN{ RS="</a>" IGNORECASE=1 } { for(o of the comments suggests).
|
|
Or just a matter of choice and call awk and sed equivalent towards usage. They both do the common search replace seemingly identically regarding i/o.
Started by LarsOn on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
sed tends to be more limited used for reporting.
G'day,
Awk is more powerful.
AWK is a fully fledged language.
SED is a stream editor, and therefore does not have variables and a few other constructs like AWK has.
|
|
I see lots of examples and man pages on how to do things like search-and-replace using sed, awk, or gawk.
But in my case, I have a regular expression that I want to run against a text file to extract a specific value. I don't want to do search-and-replace...
Started by Stéphane on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Or a version of sed with Perl-compatibleI use perl to make this....
I would use a negated character class to achieve a non-greedy match .. .
+ , I would use:
sed -n 's/^.*abc\([0-9][0-9]*\)xyz.*$/\1/p' example.txt
For awk.
|
|
Hello there, I'm trying to extract the year from this output :
zenet@zenet-laptop:~/shell$ date Mon Feb 8 21:57:00 CET 2010 zenet@zenet-laptop:~/shell$ date | cut -d' ' -f7 2010 zenet@zenet-laptop:~/shell$ date | awk '{print $6}' 2010
Are there any other...
Started by nour on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
I migrated to Perl when I found that my simple awk / sed solutions had)
cut / awk ....
It lifts heavily from sed and awk in terms of syntax of different systems.
##* } 2010
You may want to check out Perl .
|
|
I'm trying to parse various info from log files, some of which is placed within square brackets. For example:
Tue, 06 Nov 2007 10:04:11 INFO processor:receive: [someuserid], [somemessage] msgtype=[T]
What's an elegant way to grab 'someuserid' from these...
Started by Parand on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Something with all the bracketed fields, I'd use Perl:
perl -lne ' my @fields = /\[(.*?)\]/g; # do.
|
|
Hello everyone, here's my situation: I had a big text file that I wanted to pull certain information from. I used sed to pull all the relevant information based on regexp's, but each "piece" of information I pulled is on a separate line, I'd like for ...
Started by Mike on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Well, guess I should have taken a closer look at using Records in awk when I was trying to figure here's how I did this: In my original sed script I put an extra newline infront of the beginning of each record so there's now a blank line....
|