Search Results

Search: Posts Made By: smarones
1,296
Posted By itkamaraj
$ nawk -F"[<>]" '/userLabel/{a=$3} /swVersion/...
$ nawk -F"[<>]" '/userLabel/{a=$3} /swVersion/ {print a,$3}' test.txt
XXX012 R58E68
XXX235 R35X57
4,521
Posted By balajesuri
echo "345 897 567 098 123" | sed 's/ /\n/g' ...
echo "345 897 567 098 123" | sed 's/ /\n/g'
echo "345 897 567 098 123" | tr ' ' '\n'
echo "345 897 567 098 123" | awk '{for(i=1;i<=NF;i++) {print $i}}'
Did you try searching the forum? There're...
4,521
Posted By jayan_jay
In nawk if missed .. $ nawk '{gsub(/...
In nawk if missed ..

$ nawk '{gsub(/ /,"\n")};1' infile
4,521
Posted By sathish92
echo "12 11 13 15" | awk 'BEGIN { RS=" "; ORS="...
echo "12 11 13 15" | awk 'BEGIN { RS=" "; ORS=" \n"; } {print$1; } '

Video tutorial on how to use code tags in The UNIX and Linux Forums....
4,521
Posted By balajesuri
How could we forget Perl! echo "345 897 567 098...
How could we forget Perl!
echo "345 897 567 098 123" | perl -pe 's/ /\n/g'
2,004
Posted By jayan_jay
Hope it clears .. :) $ echo...
Hope it clears .. :)

$ echo "SubNetwork=XXX,MeContext=GG123,Element=1" | nawk -F'[=,]' '{print $4}'
GG123


Try this combination also .. ;)

$ fgrep -f not_upgraded_sites.txt...
2,004
Posted By funksen
at the cost of performance: while read...
at the cost of performance:


while read searchstring ; do grep -m 1 ${searchstring} file2 ; done < file1
2,004
Posted By rdcwayx
awk -F , 'NR==FNR{a[$1];next} $2 in...
awk -F , 'NR==FNR{a[$1];next} $2 in a{print;delete a[$2]}' file1 file2
3,558
Posted By durden_tyler
$ $ $ cat file1 a b c d $ $ cat...
$
$
$ cat file1
a
b
c
d
$
$ cat file2
e
f
g
h
i
j
k
i
m
$
$ perl -pne 'chomp; $_ = $ARGV eq "file2" ? "==$_" : $. > 1 ? "\n$_" : $_; END{print "\n"}' file1 file2
3,558
Posted By ahamed101
Its working for me though... bt:/tmp# echo $0 ...
Its working for me though...
bt:/tmp# echo $0
tcsh
bt:/tmp# cat 1.txt
a
b
c
d
bt:/tmp# cat 2.txt
e
f
g
h
i
j
k
i
m
bt:/tmp# awk...
11,135
Posted By ahamed101
#!/usr/bin/tcsh set val = `echo $1 | grep...
#!/usr/bin/tcsh

set val = `echo $1 | grep ".txt"`
if ( $val != "" )then
echo "Found"
else
echo "Not Found"
endif


--ahamed
3,558
Posted By CarloM
# sed "$ s/.*/&$( awk '{printf ("=%s", $0)} END...
# sed "$ s/.*/&$( awk '{printf ("=%s", $0)} END {printf ("\n")}' 2.txt)/g" 1.txt
a
b
c
d=e=f=g=h=i=j=k=i=m
2,165
Posted By Franklin52
Use nawk or /usr/xpg4/bin/awk on Solaris.
Use nawk or /usr/xpg4/bin/awk on Solaris.
2,165
Posted By CarloM
If the real files are sorted you should just be...
If the real files are sorted you should just be able to use join:
join -a1 file1 file2
(untested)
2,165
Posted By zaxxon
awk 'NR==FNR {_[$1]=$2; next} _[$1] {print $0 FS...
awk 'NR==FNR {_[$1]=$2; next} _[$1] {print $0 FS _[$1]; next}1 ' file2 file1
1 : o
2 : t
3 :
4 : f
5 : v
6 :
7 : n
8 : e
9 :
10 : a
Showing results 1 to 15 of 15

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