Search Results

Search: Posts Made By: acdc
1,590
Posted By senhia83
Another solution with awk, $ cat tmp ...
Another solution with awk,

$ cat tmp
0x000000 0x5a80 0x0060 BRA.l 0x60 ;file:UserCall.s ;function:_user_call_table ;C_sourceLine:24
0x000002 0x1bc5 RETI ;file:UserCall.s...
1,590
Posted By ongoto
@acdc I played with your original code a little...
@acdc
I played with your original code a little and shamelessly stole the %COUNTS array from derekludwig. I came up with this without much regex...
#!/usr/local/bin/perl -w

use warnings;
use...
1,590
Posted By Don Cragun
It looks like Corona688's script missed one...
It looks like Corona688's script missed one detail; the number of fields at the start of a line beginning with 0x is not a constant 2. This slight modification to his script:
awk '
{ sub(/;.*/,...
1,590
Posted By derekludwig
Or even: sed -e 's/ *;.*$//' -e 's/0x[^ ]* //g'...
Or even:
sed -e 's/ *;.*$//' -e 's/0x[^ ]* //g' inputfile | tee outfile | sort | uniq -c---------- Post updated at 05:20 PM ---------- Previous update was at 04:00 PM ----------

Perlish solution,...
1,590
Posted By Corona688
Perl looks like overkill for this. awk '{...
Perl looks like overkill for this.

awk '{ sub(/;.*/, "");
$1=""; $2="";
sub(/^[ \r\n\t]*/, "");
A[$0]++ ; print }
END {
for(X in A) print X" appeared "A[X]"...
Forum: Ubuntu 02-24-2012
103,434
Posted By itkamaraj
‘-type’ reports the types of the files that...
‘-type’ reports the types of the files that symbolic links point to. This means that in combination with ‘-L’, ‘-type l’ will be true only for broken symbolic links. To check for symbolic links when...
2,057
Posted By Scrutinizer
awk -F'[="]*' '/name/{sub(/platform\//,x);printf...
awk -F'[="]*' '/name/{sub(/platform\//,x);printf "project %s ",$2}/revision/{print $2}' RS=" " infile
2,057
Posted By knight_eon
And lil bit more change: awk -F'"' '{print...
And lil bit more change:

awk -F'"' '{print "project " $2, $6?$6:$4}' myfile.txt
2,057
Posted By guruprasadpr
awk -F'"' '{print $2, $6?$6:$4}' myfile.txt ...
awk -F'"' '{print $2, $6?$6:$4}' myfile.txt

Guru.
2,057
Posted By guruprasadpr
A small change to what you did: awk -F'"'...
A small change to what you did:

awk -F'"' '{print $2, $4, $6}' myfile.txt

Guru.
Forum: Programming 02-17-2012
3,168
Posted By Corona688
You've made a very good start actually. You just...
You've made a very good start actually. You just didn't know about open() and write().

And actually, there are a few arbitrary numbers for fd; when your program is run, it inherits a few from...
1,286
Posted By chihung
If your input is well-formed XML, it would be...
If your input is well-formed XML, it would be better to use XML XPath tools to extract the data.

Install Perl-XML-XPath in your system and you can use the following to do the job. This perl script...
1,286
Posted By ambious
you can try awk -F'"' '{print $2"\n"$6}'...
you can try
awk -F'"' '{print $2"\n"$6}' urfile.xml

How to use code tags (https://www.unix.com/how-post-unix-linux-forums/167686-forum-video-tutorial-how-use-code-tags.html) when posting data and...
35,736
Posted By Neo
Featured Books and Articles by Active Forum Members
The UNIX and Linux Forums have a number of active members that have published books or papers related to shell programming and scripting. You can check out their publications here:

Link Removed
...
28,371
Posted By Franklin52
You can't redirect the output to the inputfile....
You can't redirect the output to the inputfile. Redirect the output to a temporary file and move it to the original file, something like this:

awk '/<\/body>/ || /<\/html>/{next}1' file.html >...
28,371
Posted By dejavu88
It kinda works, but somehow I have to forward the...
It kinda works, but somehow I have to forward the output to a new file.

awk '/<\/body>/ || /<\/html>/{next}1' file.html > file2.html

is there a way to make it return the output to the original...
28,371
Posted By Franklin52
Try this: awk '/<\/body>/ ||...
Try this:

awk '/<\/body>/ || /<\/html>/{next}1' fileRegards
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 03:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy