Search Results

Search: Posts Made By: suryanarayana
1,628
Posted By Jotne
With 40 post here, you should now how to use Code...
With 40 post here, you should now how to use Code Tags

awk 'NR>=3 && NR<=5 {$0="OK "$0} 1'
surya
rama
OK ranga
OK laxman
OK rajesh
reddy
4,629
Posted By Jotne
awk '/KVB/ {$0=$0" BANK"} 1' file PS Use...
awk '/KVB/ {$0=$0" BANK"} 1' file

PS Use code tags
1,223
Posted By Franklin52
awk 'NR==FNR{a[$1]=$2;next}{print $1, $2, a[$2]}'...
awk 'NR==FNR{a[$1]=$2;next}{print $1, $2, a[$2]}' file2 file1
1,223
Posted By balajesuri
perl -lane 'open I, "< file2"; for (<I>) { ...
perl -lane 'open I, "< file2";
for (<I>) {
chomp; @x = split /\s+/;
($F[1] eq $x[0]) && print "$F[0] $F[1] $x[1]";
}; close I' file1
29,450
Posted By felipe.vinturin
The same, but add an "r" as argument: sort...
The same, but add an "r" as argument:

sort -t\| +1nr infile
29,450
Posted By jayan_jay
sort -t\| +1n infile
sort -t\| +1n infile
4,284
Posted By durden_tyler
$ $ echo "01-08-2011" | awk -F- '{print...
$
$ echo "01-08-2011" | awk -F- '{print $3$2$1}'
20110801
$
$ # GNU sed
$ echo "01-08-2011" | sed 's/^\([0-9]\+\)-\([0-9]\+\)-\([0-9]\+\)$/\3\2\1/'
20110801
$
$ echo "01-08-2011" | perl -F-...
6,449
Posted By tene
If there are only two fields, this will work. ...
If there are only two fields, this will work.

awk -F"|" '{print $2"|"$1}' filename
6,449
Posted By cgkmal
Hi suryanarayana, Try with: awk...
Hi suryanarayana,

Try with:
awk 'BEGIN{FS=OFS="|"}{print $2,$1}' inputfile
xyz|abc
567|123
Regards
Showing results 1 to 9 of 9

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