How do you print column 1 from comm output to a file?
Hi guys,
I have a script, which after running for 20 minutes,
produces a bunch of IPs. Due to a DHCP scope, some of these IPs
are not useable, so I would like to eliminate them from the final list.
I have used comm to do this, but am unable to extract the first column,
and redirect it to a file. I've spent 30 minutes trying to do this
Could you guys help me out?
I need column 1 below in the file, and I don't want column 2 in there.
I've tried awk, but it produces nothing but 40+ blank lines if I print $2 3 4, etc.
Real IPs removed.
Thanks
I need 1.2.3.1 and 1.2.3.2 and 1.2.3.3 in a file,
which will be the addresses we know we can safely use.
Hi All,
i am trying to print the solaris 11 packages in below required format, But i am unable to do that.
Current ouput :
root@abc# pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}'
NAME: QLogic 570x/571x Gigabit Ethernet Driver
VERSION: 11.11,REV=2009.11.11
... (7 Replies)
I wish to print first, third and sixth till the last column from the output of ls command
ls -ltr /app/deploy.yml
-rw-rw-r-- 1 user1 dba 27342 Aug 28 10:17 /app/deploy.yml
Desired Output:
Below command gives me the desired output.
ls -ltr /app/deploy.yml | awk '{$2=$4=$5=""; print... (6 Replies)
Given the output below (simplified) extracted from the comparison of two curl -I commands saved in two different files, I am looking for the best approach to highlight the following scenarios in a script:
this header exists only in file1.txt but this one does not
this one exists in both cases... (1 Reply)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
I have n files and I am using cat to combine them in to one.
Before that simply add the name of the output file to 4th column and then print the output. Is it possible ?
input1
chr start end name 0 + key
input2
chr start end name 0 + key
inputn... (1 Reply)
I'm looking to compare two delimited files:
file1
one|xxx
two|xxx
three|xxx
file2
four|xxx
five|xxx
six|xxx
one|yyy
Where the result is the the file2 row whose first field does NOT appear in file1. I.e., the correct result would be:
result
four|xxx (3 Replies)
Hi friends,
My file is like:
Second file is :
I need to print the rows present in file one, but in order present in second file....I used
while read gh;do
awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile
done < secondfile
but the output I am... (14 Replies)
I'd like to eliminate the rows in two files that do not share a common value in the first column. Here's my tortured logic that is way too inefficient to consider, but might show what i'm trying to do (assume the files have been sorted):
cut -f1 -d '|' file1 > file1.dat
cut -f1 -d '|' file2 >... (4 Replies)