10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
file2 content
f1file2 content
f1,1,2,3,4,5
f1,2,4,6,8,10
f10,1,2,3,4,5
f10,2,4,6,8,10
f5,1,2,3,4,5
f5,2,4,6,8,10awk 'FNR==NR{a;next}; !($1 in a)' file2 file1output
f10,1,2,3,4,5
f10,2,4,6,8,10
f5,1,2,3,4,5
f5,2,4,6,8,10awk 'FNR==NR{a;next}; ($1 in a)' file2 file1output
nothing... (4 Replies)
Discussion started by: gksenthilkumar
4 Replies
2. Shell Programming and Scripting
Hi,
I have around 10 files in a folder in which I want to change the file format from tab(\t) to pipe(|) with some changes in the fields as well. Below is the code, while tmp file is getting generated but move command is not working, please help
Following is the code
awk -F"\t" '{print... (2 Replies)
Discussion started by: siramitsharma
2 Replies
3. Shell Programming and Scripting
Hi Experts,
Can you please advise , why I am not able to make it work, or why this is not working: I spent quite a lot of time on this figuring out , but not working,
file :
This is a test file thanks for your reply
This is another file again
Have a nice day this is a small file... (3 Replies)
Discussion started by: rveri
3 Replies
4. Shell Programming and Scripting
Hi All,
This code is not working when trying with "else" : Am I missing something,
uptime|sed 's/,/ /g' | awk '{ if ($10 >1) { print ( " :: UPTIME GT 1 : ALERT" )} ;else print "OK" }'
Getting this error:
syntax error The source line is 1.
The error context is
{ if... (4 Replies)
Discussion started by: rveri
4 Replies
5. Shell Programming and Scripting
Can you please help me on belw awk comparsion which doest not work
cat employee_list
NAME Last-login
Jack 03/25/2013
Maneul 03/26/2013
Eric 03/26/2013
Samuel 03/28/2013
loak 03/29/2013
zac 03/29/2013
this is my awk .. it gives me error
cat employee_list | awk '(($2=='date... (3 Replies)
Discussion started by: Sara_84
3 Replies
6. UNIX for Advanced & Expert Users
Hi,
Putting across a few awk expressions.
Apart from the last, all of them are working.
echo a/b/c | awk -F'/b/c$' '{print $1}'
a
echo a/b/c++ | awk -F'/b/c++' '{print $1}'
a
echo a/b/c++ | awk -F'/b/c++$' '{print $1}'
a/b/c++
Request thoughts on why putting a '$' post double ++... (12 Replies)
Discussion started by: vibhor_agarwali
12 Replies
7. Shell Programming and Scripting
Hi All,
i'm trying awk commnad to read only file names with the help of below command :-
ls -l tmp*.txt | awk { 'print $9' } | head -1
The command is working fine :o on command line, but when i trying it in script then its not working
$var1=`ls -l tmp*.txt | awk { 'print $9' } | head -1`... (3 Replies)
Discussion started by: doitnow
3 Replies
8. Shell Programming and Scripting
Hi All,
I have a server.xml file which looks something like.
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100"... (2 Replies)
Discussion started by: nua7
2 Replies
9. Shell Programming and Scripting
OK I am somewhat new to UNIX programming please see what you can do to help.
I have a flat file that is a fixed length file containing different records based on the 1st character of each line. The 1st number at the beginning of the line is the record number, in this case it's record #1.
I... (3 Replies)
Discussion started by: ambroze
3 Replies
10. Shell Programming and Scripting
I am facing some strange problem.
I know, there is only one record in a file 'test.txt' which starts with 'X'
I ensure that with following command,
awk /^X/ test.txt | wc -l
This gives me output = '1'.
Now I take out this record out of the file, as follows :
awk /^X/ test.txt >... (1 Reply)
Discussion started by: videsh77
1 Replies