... What have you tried so far? Show us and we'll try to help. Peter S Tillier "Who needs perl when you can write dc, sokoban, arkanoid and an unlambda...
Here is what I have: { revenue[$1,$2] += $3 sum += $3 } END { for (k in revenue) { split(k,x,SUBSEP) name = x[1] if (x[1] == name) { print x[1], x[2],...
I have an output file, ascii from a unix machine, where every field is on a new line with a line ---- Record Start ---- denoting the start of the record and...
... Which doesn't give the required output that Victor asked for! $ cat CIS188.awk # CIS188.awk { revenue[$1,$2] += $3 sum += $3 } END { for (k in revenue) { ...
Peter S Tillier wrote: Oops, sorry folks, I just realized that I posted the wrong code and output - it as from an earlier version. I'll send the corrected one...
Peter, Thanks for the code. It works perfectly well. Victor Peter S Tillier <peter_tillier@...> wrote: Peter S Tillier wrote: Oops, sorry folks, I just...
Peter, One problem I found out with your code is the Mac's sales figure for James is missing from the report. $cat salesdata bill shampoo 250 james mac 3000 ...
... Yes, sorry that was the wrong code that I posted. I'll post the corrected one "real soon now". Apologies once again. Peter S Tillier "Who needs perl when...
Peter, I have come up with another version. It does not quite work yet. But here is the interaction and the code. $cat salesdata victor pc 2500 james pc 2400 ...
... OK, here's what I meant to post earlier! $ cat VictorY01.dat Victor MAC 1500 James Mac 2500 Bill Shampoo 150 Victor PC 1000 Bill PC 1200 James PC 1200 $...
Hello Can I use gawk to convert small letters to big letters?. I have a txt file with many first names like this Anders HANS BILL Eddie I want all the names to...
The quickest way to convert lowercase to uppercase is probably by using tr: cat <filename> | tr "[a-z]" "[A-Z]" In gawk you might be able to use the gsub...
Maartens Lourens (WMR)
lourenwm@...
Sep 17, 2003 9:08 am
80
hi all, i am new to awk programming. As i understand, each record from the input file is subjected to all the instructions in the awk script file sequentially....
According to the Unicode Consortium, Gawk supports Unicode. But, I haven't been able to find an executable for Windows that seems to work (or I don't know how...
I know notting about unicode, but I noticed that the NoteTab-editor can read and write text in UNICODE format. NoteTab works fine with awk (e.g. liberary ...
Hi, I would to do this in a gawk script: BEGIN { as="188.772.11.11" while (getline <"../datas"){ split($0,s,";") if(/$as;/) { print $0 } } } but it fails. Of...
Try if ( $0 ~ as ) { print $0 } In general, once you stuff a regular expression into a variable, you cannot use the / / syntax--that's only for literal regular...
Hi Thanks for answering - I kinda desperate! I have something like that: for i in $(ls *); do #here it is for files in a loop sed '/something/,/something/d' $i...
Hi ya Urszula Hope you're well. It doesn't seem that complex. Are your lines: u> -3.085902 (1a) u> -0.40908 (2a) u> 1.968368 (3a) u> -3.79142 (4a) u> -3.79142...
Hi Bruno... I'm confused. If you are asking about awk, there's no $. 'as' I take it is a string RegExp ? Well, "." is a meta-character, or special character....
Suppose you want to do something like this: cat file1 | gawk -f script.awk file2 file3 file4 How do you handle this? gawk (GNU Awk 3.1.1) seems to skip over...
... Some UNIX/LINUX utilities allow you to include "-" by itself among a list of filenames on the command line as an indication to read the standard input ...
See GNU project on Sourceforge.net ... From: goodmis To: geeksthatgawk@yahoogroups.com Sent: Tuesday, April 27, 2004 11:33 PM Subject: [Geeks that Gawk] Need...
Thanks William, I downloaded UnDows and it was just what I needed. I have to admit I am a little rusty on my French. Thanks Again Jason Give me (G)awk and I...
It's a pleasure Jason Did you get what you wanted ? The real gawk is on the GNU list http://sourceforge.net/project/showfiles.php?group_id=23617 with all the...
I am running UnDows and I would like to use a switch statement. Is this possible? switch ($1) { case 1: printf("%s\n", $1) case 2: printf("%s\n", $2) } ...
I don't think there is a switch statement in (g)awk. In this situation, I've always used the following construct: if ( ) { } else if ( ) { } else { } --Albert...
Thanks Albert, I saw something about a switch in some gawk documentation. NOTE: This subsection describes an experimental feature added in gawk 3.1.3. It is...