10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Discussion started by: chidori
11 Replies
2. Shell Programming and Scripting
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies
3. Shell Programming and Scripting
Hi.
I have a tab separated file that has a couple nearly identical lines. When doing:
sort file | uniq > file.new
It passes through the nearly identical lines because, well, they still are unique.
a)
I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies
4. Shell Programming and Scripting
Similar question... I have a space delimited text file and I want to only print the lines where the 3rd word/field/column is equal to "01"
awk '{if $3 = "01" print $0}'
something like this.
I meant to say:
only print line IF 3rd field is 01 (2 Replies)
Discussion started by: ajp7701
2 Replies
5. Shell Programming and Scripting
How can i awk/sed to print the last line of an recurring pattern on the 3rd field?
Input lines:
123456.1 12 1357911 11111.1 01
123456.2 12 1357911 11111.2 02
123456.3 12 1357911 11111.3 03
123456.4 12 1357911 11111.4 04
123456.5 12 1357911 11111.5 05
246810.1 12 1357911 22222.1 01... (4 Replies)
Discussion started by: ux4me
4 Replies
6. Shell Programming and Scripting
I have a file whose format is like the following
350,2,16.2,195,2,8.0
every 3rd column of this file should be deleted. How can i achieve this
tried with the following
iostat -D -l 2 | /usr/xpg4/bin/awk ' NR>2 { for (i=0;i<=NF;i++)if(i%3==0)$i=""};'
but no luck (3 Replies)
Discussion started by: achak01
3 Replies
7. Shell Programming and Scripting
2 files, first one has 3 fields seperated by ||| and 2nd one is plain text.
I want to copy the lines from the first file if the 2nd field is present anywhere in the text file. This is what I've tried, but I'm new to awk and shell scripting in general so it's kinda broken.
#!/bin/awk -f
BEGIN... (15 Replies)
Discussion started by: FrancoisCN
15 Replies
8. Shell Programming and Scripting
hi, i have two files, both with 3 columns, the 3rd column has common values between the two files and i want to produce a 3rd file with 4 columns.
file 1
a, ,b c
file 2
a, b ,d
I want to compare the 3rd value and if a match print to file 3 with the 3 columns from the first file... (11 Replies)
Discussion started by: borderblaster
11 Replies
9. Shell Programming and Scripting
I'm executing "wc -lc" command in a c shell script to get record count and byte counts and writing them to a file. I get the result with the full pathname of the file. But I do not want the path name to be printed in the output file. I heard that using Awk we can get this but I don't have any... (4 Replies)
Discussion started by: stakuri
4 Replies
10. Shell Programming and Scripting
Hi,
I need a shell script which should find the latest date in the field of file and print that line only. For eg.,
I have a file /date.log
Name Date Status
IBM 06/06/07 close
DELL 07/27/07 open
DELL 06/07/07 open
: : :
From... (1 Reply)
Discussion started by: cvkishore
1 Replies