Just the indexing? I will try to explain all of it.
Firstly, it is often (and better) written:
Each record (a line here) is split into fields. The first field is addressed with $1, the second with $2, and so on. The entire record is $0. So it uses $1 as the index into the array called a. Stored there is the count of occurances (the ++ operator increments the value). The first time it is seen though, it evaluates as 0. (It returns 0 but is then set to 1, called post-increment). So the ! operator will negate that. So it will only print the first line where $1 is unique, because each successive iteration of that same $1 will then become 0 after !.
This User Gave Thanks to neutronscott For This Post:
Hi all,
i have a data array as follows.
array=ertfgj2345
array=456ttygkd
.
.
.
array=errdjt3235
so number or elements in the array can varies depending on how big the data input is.
now i have a variable, and it is $1 (there are $2, $3 and so on, i am only interested in $1).
... (9 Replies)
dear all,
i have file with format like this
file_master.txt
20110212|231213|rio|apri|23112|222222
20110212|312311|jaka|dino|31223|543234
20110301|343322|alfan|budi|32131|333311
...
i want filter with output like this
index_nm.txt
rio|apri
jaka|dino
...
index_years.txt
20110212... (7 Replies)
hello guys,
I have a file like this:
input.dat
Push-to-talk
No
Coonection
IP support
Support for IP telephony
Yes
Built-in SIP stack
Yes
Support via software
Yes
Microsoft
Support for Microsoft Exchange
Yes
UMA (5 Replies)
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Hello All,
I have data like this in a column.
0
1
2
3
0
3
4
5
6
0
1
2
3
etc. where 0 identifies the start of a pattern in my data.
So I need the output like below using either awk/sed.
0 1 (2 Replies)
Hi All
I think I might have bitten off more than I can chew here and I'm hoping some of you guys with advanced pattern matching skills can help me.
What I want to do is index the occurrence of variable names within a library of scripts that I have. Don't ask why, I'm just sad like that...
... (3 Replies)
Hello,
This is pretty simple, I`m looking for a faster and better method than brute force that I`m doing.
I have a 20GB file looks like
Name1,Var1,Val1
Name1,Var2,Val2
Name2,Var1,Val3
Name2,Var2,Val4
I want 3 files.
Nameindex
1 Name1
2 Name2
... (2 Replies)
Hi
Does anyone know of an efficient way to index a column of data in file2 to print the coresponding row in file1 which corresponds to the data in file2 AND 30 rows preceding and after the row in file1.
For example suppose you have a list of numbers in file2 (single column) as follows:... (6 Replies)