Search Results

Search: Posts Made By: tech_frk
1,829
Posted By RudiC
See post#3
See post#3
1,734
Posted By Aia
sed 's/application-[-0-9]*/application/'...
sed 's/application-[-0-9]*/application/' tech_frk.file
houston : application : 200
Dallas : application :700
Huntsville : development-102 :600
cary : release-123-1 : 750
losangeles :...
1,066
Posted By RavinderSingh13
Hello tech_frk, Could you please try...
Hello tech_frk,

Could you please try following and let us know how it goes then.

awk -F, '{++A[$1];print A[$1] OFS $0}' Input_file
OR
awk -F, '{++A[$1];$0=A[$1] OFS $0} 1' Input_file
...
1,391
Posted By Akshay Hegde
awk 'FNR==NR{ A[$2]++; if(NR==1)print $0,"COL5";...
awk 'FNR==NR{ A[$2]++; if(NR==1)print $0,"COL5"; next}FNR>1{print $0,A[$2]}' infile infile
1,391
Posted By RavinderSingh13
Hello tech_frk, EDIT: Chaged the code by...
Hello tech_frk,

EDIT: Chaged the code by reading one file.

Following should work.


awk 'NR==1{$(NF+1)="COL5";print $0} NR>1 {X[$2]++;Y[++i]=$0 OFS X[$2];} (i in Y){print Y[i]}' ...
9,858
Posted By Akshay Hegde
awk 'FNR==NR{A[$1];next}$1 in A' Filter.txt...
awk 'FNR==NR{A[$1];next}$1 in A' Filter.txt Data.txt >Out.txt

---------- Post updated at 11:42 AM ---------- Previous update was at 11:39 AM ----------

For given sample this also will work
...
9,858
Posted By Smiling Dragon
#!/bin/sh while read line do ...
#!/bin/sh
while read line
do
firstword=`echo "$line" | awk '{ print $1 }'`
if egrep "^$firstword\$" filterfile.txt
then
echo "$line"
fi
done
Depending on your OS, you might need...
3,028
Posted By chihung
Install perl XML::XPath module # yum install...
Install perl XML::XPath module

# yum install perl-XML-XPath.noarch
or
# perl -MCPAN -e 'install XML::XPath'


Try this:

#! /usr/bin/perl
use XML::XPath;
$,=" ";
...
Showing results 1 to 8 of 8

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