Search Results

Search: Posts Made By: zozoo
1,076
Posted By vgersh99
I think you're thinking of the wrong "joining"...
I think you're thinking of the wrong "joining" key.
try this:

awk -F, 'FNR==NR {f1[$1]=$2;next} $4 in f1 {print $0,f1[$4]}' OFS=, keys.csv source.csv
1,977
Posted By Scrutinizer
Another way: awk 'NF>1{sub(/[^,]*$/,$NF)}1'...
Another way:
awk 'NF>1{sub(/[^,]*$/,$NF)}1' file

or
sed 's/[^,]* //' file


--
(same thing with awk: )
awk '{sub(/[^,]* /,x)}1' file
1,977
Posted By RavinderSingh13
Hello zozoo, Could you please try following...
Hello zozoo,

Could you please try following and let me know if this helps you.

awk -F',| ' '{print $1,$2,$3,$4,$5,$NF}' OFS=, Input_file
Thanks,
R. Singh
1,977
Posted By RavinderSingh13
Hello zozoo, There are lot of questions...
Hello zozoo,

There are lot of questions in output shown by you.
I- By what logic you have removed lines a,b,c,i,m,nothing and d,i,j,e,w,nothing?
II- By which logic line z,b,d,f,e,s t...
6,298
Posted By Corona688
General Purpose XML Processing
I've been kicking this around for a while now, I might as well post it here.
[edit] v0.0.9, now properly supporting self-closing tags.
[edit] v0.0.8, an important quoting fix and a minor change...
2,475
Posted By vgersh99
awk -f rex.awk myFile, where rex.awk is: ...
awk -f rex.awk myFile, where rex.awk is:


BEGIN {
pat2move="TYPE = Router"
patBelow="[[Cisco]]"
}
$0 ~ pat2move {next}
$0 ~ patBelow { $0 = $0 ORS pat2move}
1
Disclaimer:...
1,294
Posted By RudiC
You were halfway there. Try awk -F, '{if (a[$2]<...
You were halfway there. Try awk -F, '{if (a[$2]< $3) {a[$2]=$3;b[$2]=$1}} END{for(i in a){print b[i],i,a[i];}}' OFS="," file
zzz,1,3000
ttttt,2,500
xyxy,3,1000

or awk -F, 'a[$2] < $3...
1,291
Posted By Akshay Hegde
@zozoo : You should sort before using uniq,...
@zozoo :

You should sort before using uniq, in current example it's fine, but in some cases there will be chances of printing duplicates.
3,698
Posted By Akshay Hegde
@ m_raheelahmed which OS uname -a @zozoo >>...
@ m_raheelahmed which OS uname -a

@zozoo >> appends standard output to file and just ls -1 is enough
1,774
Posted By Akshay Hegde
$ cat file1 ...
$ cat file1
>ENSGALG00000000011|ENSGALT00000000012|57|1123|1125
AACTGTGTGTTTTTT
>ENSGALG00000000012|ENSGALT00000000013|57|1145|1155
AAAAAAGGTCCTGTGTGC...
1,716
Posted By Yoda
awk -F: ' # Set colon (:) as field separator ...
awk -F: ' # Set colon (:) as field separator
# Checking if pattern: Preferred instances exists in current record
/Preferred instances/ {
# Add last...
7,421
Posted By Corona688
"interactive password authentication" means...
"interactive password authentication" means "password typed by a human being in realtime authentication" and no substitutes for humans are acceptable to the login system.

You'd have to use a...
5,889
Posted By alister
In one pass without xargs (tested with an old GNU...
In one pass without xargs (tested with an old GNU find):

find /usr/local/apache/htdocs \
\( -user apache -group apache -o -exec chown apache:apache {} + \) \
\( -type d ! -perm 755 -exec...
9,905
Posted By Yoda
From gunzip man page: Files created by zip can...
From gunzip man page:
Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method.
This feature is only intended to help conversion of...
1,898
Posted By Yoda
Sure, by the way this code works only if the last...
Sure, by the way this code works only if the last field is separated by comma and there are no spaces in between them:
awk '
{
n = split ($NF, A, ",") # Split last...
1,898
Posted By Yoda
An awk solution: awk '{ n=split($NF,A,",");...
An awk solution:
awk '{ n=split($NF,A,","); while (++i<=n) { print $1, A[i] } i=0 }' file
3,893
Posted By alister
Or @ARGV. Regards, Alister
Or @ARGV.

Regards,
Alister
1,831
Posted By Yoda
I would highly recommend to avoid using this...
I would highly recommend to avoid using this syntax: for i in `cat file1`

You can find the reason here (http://partmaps.org/era/unix/award.html#backticks)
1,066
Posted By Yoda
Few awk solutions: awk -F\" '{print $2}' file ...
Few awk solutions:
awk -F\" '{print $2}' file
awk '{gsub(/[">]/,x)}1' file
awk '{match($0,/^".*">/); print substr($0,RSTART+1,RLENGTH-3)}' file
1,066
Posted By Scrutinizer
tr -d '">' < file
tr -d '">' < file
1,066
Posted By RudiC
$ sed 's/[">]//g' file 17 37 15 1 ...
$ sed 's/[">]//g' file
17
37
15
1
1925489
6
282589
22564
42123685
5
1,066
Posted By hanson44
$ sed 's/"\(.*\)">/\1/' file1 17 37 15 1 ...
$ sed 's/"\(.*\)">/\1/' file1
17
37
15
1
1925489
6
282589
22564
42123685
5
Forum: Programming 04-08-2013
2,965
Posted By durden_tyler
I don't know the structure of your table or the...
I don't know the structure of your table or the data in it, so let's assume the data looks like this:


SQL>
SQL> --
SQL> select id,
2 TO_CHAR (dt, 'DD/MM/YYYY HH24:MI:SS') AS dt,
...
Forum: Programming 04-08-2013
2,965
Posted By stuckinboredom
You can find you starting point and add 86400 to...
You can find you starting point and add 86400 to it for every 12 hours like this:
for example epoch time for 4/8/2013 10:00:00 GMT is 1365415200

Like below in Shell script:

FTime=1365415200 ...
18,041
Posted By Corona688
Sure. Whenever you do print, do print ... >...
Sure. Whenever you do print, do print ... > FILENAME ".html"

And instead of NR use FNR
Showing results 1 to 25 of 34

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