Search Results

Search: Posts Made By: juzz4fun
5,396
Posted By juzz4fun
I would create a korn shell script as below, and...
I would create a korn shell script as below, and then pass file1 and file2 as parameters to it:

#!/bin/ksh
infile1=$1
infile2=$2
for name in $(cat ${infile1})
do
egrep ${name} ${infile2} >...
2,020
Posted By juzz4fun
Hi, From what I understand, you want to print...
Hi,
From what I understand, you want to print first column whenever there are exactly two "M"s in 2nd, 3rd, 4th and 5th columns combined. If that is the case (and file is tab delimited), I would...
4,546
Posted By juzz4fun
Apart from commands df and mount, I don't know...
Apart from commands df and mount, I don't know much.... specially using these commands for multiple servers. :(
2,242
Posted By juzz4fun
if you don't want space as default field...
if you don't want space as default field separator, you can define one using OFS
BEGIN{FS=OFS=","} or awk -F, '{.......}' OFS=\, input
1,462
Posted By juzz4fun
To include the tags (i.e. Pattern_1 and Pattern_2...
To include the tags (i.e. Pattern_1 and Pattern_2 in the output), bartus11's solution will work for sure...
But if you do not want the tags, you could try:

nawk '/Pattern_2/{ flag=0 } flag;...
33,193
Posted By juzz4fun
awk '{print $0 " is a great language"}'...
awk '{print $0 " is a great language"}' input
3,945
Posted By juzz4fun
You mean output like 4 12 5 13 ?? Try:...
You mean output like
4 12
5 13
??

Try:
awk '$1==$2{print $1" "$3}' input
1,142
Posted By juzz4fun
One more way: awk '{print}' RS=# inputfile
One more way:

awk '{print}' RS=# inputfile
1,535
Posted By juzz4fun
Try this: something should occur before 122344...
Try this: something should occur before 122344 strings in order to delete the line

sed '/something.*122344/d' infile
1,637
Posted By juzz4fun
How about this? awk -F',' '$14~/910[0123] &&...
How about this?
awk -F',' '$14~/910[0123] && $42 != 0' *_201304*.csv | wc -l > pax1

Here 910[0123] will evaluate to 9100, 9101, 9102, 9103

regards,
juzz4fun
1,637
Posted By juzz4fun
Create a script: for i in *_201304*.csv do...
Create a script:

for i in *_201304*.csv
do awk -F',' '$14~/910[0123]/ && $42 != 0' $i | wc -l >> parx1
done

Hope this helps..
1,637
Posted By juzz4fun
Looks difficult for me to express all these using...
Looks difficult for me to express all these using single regexp/pattern, but surely you can do that using multiple awk.
2,744
Posted By juzz4fun
Will this work for you? Content of program: ...
Will this work for you?

Content of program:
awk '{print $2" " $1}'

then you execute it like..

./program < input.in > output

This will output as..

cat output
b a
2,399
Posted By juzz4fun
If you want to rename the files as well, we can...
If you want to rename the files as well, we can incorporate Yoda's logic into a script..


#!/bin/bash
for i in *.txt
do a=`ls $i | awk -F"_" 'length($(NF-1))!=8{$(NF-1)="20"$(NF-1)}{print}'...
2,399
Posted By juzz4fun
@Yoda: Thanks for the input... just few months...
@Yoda: Thanks for the input... just few months old to the world of Unix... :)
2,145
Posted By juzz4fun
It can also be done either of the below way: ...
It can also be done either of the below way:

awk '{print $1 " " $2 " " $3 " " $6 " " $7 " " $8 " " $9}' file

awk '{$4=" "; $5=" "; print}' file

Is this what you were looking for?
Showing results 1 to 16 of 16

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