Search Results

Search: Posts Made By: teefa
Forum: Programming 02-16-2014
8,124
Posted By fpmurphy
Given your apparent difficulties following my...
Given your apparent difficulties following my GNU_EFI ASN.1 X.509 parser code, here is an example of another way to parse X509 .pem files using the OpenSSL development library.

#include <stdio.h>...
Forum: Programming 01-26-2014
8,124
Posted By fpmurphy
A quick Internet search will point you to the...
A quick Internet search will point you to the source code for many ASN.1 tools. Is there any reason that you cannot use an existing compiler or decompiler whose source code is publicly available?
...
2,184
Posted By Ygor
Try...$ cat file1 Tom|london Tom|london ...
Try...$ cat file1
Tom|london
Tom|london
Tom|Paris
Adam|Madrid
Adam|NY
Tom|amsterdam
Tom|amsterdam
Tom|amsterdam
Tom|amsterdam

$ awk -F'|'...
2,184
Posted By krishmaths
awk '{++a[$1]} END{for(i in a){print i"|"a[i]}}'...
awk '{++a[$1]} END{for(i in a){print i"|"a[i]}}' inputfile | awk -F"|" '{if($3>b[$1]){b[$1]=$3;c[$1]=$2}} END{for(i in b){print i"|"c[i]}}'



If you have two mappings for a given first field in...
2,184
Posted By Skrynesaver
perl -ne...
perl -ne '($name,$location)=split/\|/,$_;$locations{$name}{$location}++; END{for $name (keys %locations){$max=0;for $location (keys %{$locations{$name}}){if...
1,679
Posted By zaxxon
I am not sure if I understood what you want,...
I am not sure if I understood what you want, since the 2nd post for line "adam,12345" differs from the example in post 1. There are 2 new fields that weren't there in post 1.
Seems there is some...
872
Posted By vidyadhar85
try.. awk -F,...
try..


awk -F, '{if($3=="win"){A[$1","$2]++}else{B[$1","$2]++}}END{for(i in A){print i","A[i]"win,"B[i]"lose"}}' filename
7,510
Posted By fpmurphy
You can use the popular bits2str function from...
You can use the popular bits2str function from GAWK manual

function bits2str(bits, data)
{
if (bits == 0)
return "0"

mask = 1
for (; bits != 0; bits = rshift(bits, 1))
...
1,840
Posted By mjf
I think what you might be looking for is...
I think what you might be looking for is something like this:

sort -t"|" -k1,2 -k3,3r infile

The above will sort pipe delimited file starting with field 1 and ending with field 2 ( -k1,2 )...
1,000
Posted By user8
I just tried this with GNU sort and awk and it...
I just tried this with GNU sort and awk and it seems to work fine:
sort -r -k5 t3 | awk '!a[$1,$3]++'PS: This record has no space between "Italy" and the pipe character.
Italy| John | 08:22:12:349
1,002
Posted By MadeInGermany
Please look at this thread, posted some hours...
Please look at this thread, posted some hours ago:
https://www.unix.com/shell-programming-scripting/215693-help-needed-delete-script.html#post302768281
1,002
Posted By rbatte1
Have a read of the manual page for find and the...
Have a read of the manual page for find and the section on -mtime

That might have what you need.



Robin
1,159
Posted By elixir_sinari
And consider the case where filenames contain...
And consider the case where filenames contain spaces/new-lines.
Also, you don't need a long listing there. A plain ls -rt *.txt is sufficient to get the filenames in the required order.
1,159
Posted By itkamaraj
when you do ls -lrt *.txt you will not get the...
when you do ls -lrt *.txt you will not get the total word. So you dont need to use the awk
2,050
Posted By Chubler_XL
Sorry should test before I post, this is what you...
Sorry should test before I post, this is what you want:
awk -v target="${1:-515|516}" '
$1 == "End" && $2 == "of" {
if( value["Id"] ~ target )
print value["DataField"];
...
1,574
Posted By Scott
Have a glance at section 5 of the crontab...
Have a glance at section 5 of the crontab (https://www.unix.com/man-page/OSX/5/crontab/) manual page. It's all explained there.

"cron" runs in the "background", if that's what your other point...
1,574
Posted By Scott
Cron? 0 8 * * * /path_to/myScript
Cron?


0 8 * * * /path_to/myScript
2,039
Posted By frappa
I just used 1st_param, 2nd_param, 3rd_param as a...
I just used 1st_param, 2nd_param, 3rd_param as a quick way to indicate the parameters passed to your script test.sh (it takes the variables file, file1 and file2 from the arguments $1, $2, $3, isn't...
2,039
Posted By frappa
ok, so you could just use a for cicle to call...
ok,
so you could just use a for cicle to call your script, like:
for sourcefile in `ls /mo/omar/teefa/filesDBM/IBM*.txt` ; do /path/to/test.sh $sourcefile 2nd_param 3rd_param ; done
The shell will...
2,039
Posted By frappa
Hi you can use the date command inside backticks...
Hi you can use the date command inside backticks (`) in order to provide a date as filename for the output file, i.e.:
/path/to/test.sh 1st_param 2nd_param `date '+%Y%M%d'`.txt
resulting in the...
1,844
Posted By varathaneie
same output but easy command
Hope this also gives the same output which is easier to understand,

echo "datarecords.txt: male | datarecords.txt: male | datarecords.txt: female" | sed 's/datarecords.txt//g'
1,844
Posted By Corona688
grep doesn't do filtering like that, you can pipe...
grep doesn't do filtering like that, you can pipe it into sed.
$ echo "datarecords.txt: male | datarecords.txt: male | datarecords.txt: female" | sed 's/^[^:]*: /:/;s/|[^:]*: /| :/g'
:male | :male...
4,337
Posted By Chubler_XL
That is just to clear the 'value' array as you...
That is just to clear the 'value' array as you awk dosn't support delete value. It's splitting the blank string with a seperator of "." and putting the blank result into the 'value' array.
4,337
Posted By Chubler_XL
Some slight changes should get it working for...
Some slight changes should get it working for you:

nawk -v target=${1:-515} '
$1 == "End" && $2 == "of" {
if( value["Id"] == target )
print value["DataField"];
...
4,337
Posted By vgersh99
./List.ksh 300 <list >savedOutputFile
./List.ksh 300 <list >savedOutputFile
Showing results 1 to 25 of 31

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