Search Results

Search: Posts Made By: som.nitk
1,310
Posted By ygemici
# awk '/^ */{print $3}' FS='[<>]*' file ...
# awk '/^ */{print $3}' FS='[<>]*' file
RMDatabase
root
test

# sed -n '/^ */s/ *[></]*\|[A-Z]*Name\|PWord//pg' file
RMDatabase
root
test

# cut -d'<' -f2 file|cut -d'>' -f2

RMDatabase...
1,057
Posted By Franklin52
Try: awk 'NR==FNR{a[$2]=$0;next}$5 in a...
Try:
awk 'NR==FNR{a[$2]=$0;next}$5 in a {$(NF-1)=a[$5]}1' FS="_" file2.txt FS="|" OFS="|" file1.txt
1,340
Posted By Scrutinizer
Try: perl -plne 's/([^,]*(,[^,]*){3}).*/$1/'
Try:
perl -plne 's/([^,]*(,[^,]*){3}).*/$1/'
1,340
Posted By durden_tyler
$ $ cat f63 693t622, ZOMBIAC SERVICES, ,...
$
$ cat f63
693t622, ZOMBIAC SERVICES, , 3267, N
985g367, DRUMBASH, , 2376, Y, 457
983y106, STEFFI, , 2344, N, 2345, B
$
$ # Using autosplit
$
$ perl -F, -plane '$_=join(",",@F[0..3])' f63...
5,508
Posted By fpmurphy
Change my $YN = <>; to my $YN =...
Change

my $YN = <>;

to

my $YN = <STDIN>;
7,283
Posted By masterpiece
Hi Rohon, Superb!! :b::b: Exactly as i want....
Hi Rohon,

Superb!! :b::b: Exactly as i want.

Thanks, you saved my day
7,283
Posted By
while read line1 do line2=`grep "$line1"...
while read line1
do
line2=`grep "$line1" file2`
if [ ! -z "$line2" ] ; then
echo "$line2" >> file3
else
echo "" >> file3
fi
done < file1
1,950
Posted By vgersh99
The condition FNR==NR will be true only for the...
The condition FNR==NR will be true only for the FIRST file passed to awk for processing. Therefore, we read file2 into hash FIRST - then proceed with the processing for the other/file1 files.
5,041
Posted By pludi
So if invoked explicitly, it does work?...
So if invoked explicitly, it does work? (Remember, we aren't psychics, we only know what you tell us)

What's the difference between the working system and the non-working one, other than different...
Showing results 1 to 9 of 9

 

Featured Tech Videos

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