Search Results

Search: Posts Made By: Gery
2,712
Posted By spacebar
This is one method to determine if two files have...
This is one method to determine if two files have the same size and then act upon it:

fs1=`wc -c test1`
fs1="${fs1##+([[:space:]])}"
fs1=`echo $fs1 | cut -d ' ' -f1`

fs2=`wc -c test2`...
2,008
Posted By birei
For also positive numbers use: $ sed -e...
For also positive numbers use:

$ sed -e 's/^[^-0-9].*$/>>/' infile
2,008
Posted By birei
Hi Gery, Try with: $ cat infile ...
Hi Gery,

Try with:

$ cat infile
geometry,geometry_vertex_count,Id,strnum,platecode,datatype,dtnum,refnum,appearance,disappeara,color,geogdesc,datatype_ft_style,import_notes...
2,313
Posted By Scrutinizer
Hi, you could for example give every intermediate...
Hi, you could for example give every intermediate value the value of the previous known value:
awk 'NR==FNR{if(!i)i=$1; while(i<=$1)A[i++]=$2;next} {print A[int($1+.5)]}' fileB.txt fileA.txt
2,313
Posted By Scrutinizer
It is because for some entries in fileA there is...
It is because for some entries in fileA there is no match in fileB and then those lines do not get printed. If you would use:
awk 'NR==FNR{A[$1]=$2;next} {i=int($1+.5);print A[i]}' file2 file1Those...
2,313
Posted By Scrutinizer
You need to flip file1 and file2 around. try: ...
You need to flip file1 and file2 around. try:
awk 'NR==FNR{A[$1]=$2;next} {i=int($1+.5)} i in A {print A[i]}' file2 file1
2,313
Posted By frappa
while read line do num=`echo ${line} | awk...
while read line
do
num=`echo ${line} | awk -F "." ' { print $1 } '`
egrep "^${num} " file2 | cut -d" " -f2 >> output
done < file1
1,653
Posted By jim mcnamara
try this: awk ' NR==1 {printf("%s", $0);...
try this:

awk ' NR==1 {printf("%s", $0); next}
{printf("\n%s %s", $1, $2);extra=$3 }
END {print " ", extra} ' inputfile > ourputfile
Showing results 1 to 8 of 8

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