mrn,
Thanks for your post. I cant sort as I need to maintain the order, meaning the first occurrence of a string must remain in its original position.
PH,
Your 'awk' statement works great. Appreciate it!
Thanks,
Arun
Hello, I have the following input file.
Sri Lanka v Pakistan
England v West Indies
Sri Lanka v Pakistan
West Indies A v India A
England v West Indies
West Indies A v India A
England v West Indies
West Indies A v India A
Sri Lanka v Pakistan
England v West Indies
West Indies A v India A
Sri...
...-f" as the string match is not exact. I read in the variable values for each line with FS=, and use "egrep -v" as below...
while IFS=, read A B C
do
egrep -v "$A.*$B.*$C" file1 > temp
mv temp file1
done < file2
Looking for a simpler, one-line approach please...
Thanks in advance...
Arun
This is done, albeit not as I originally intended...
http://www.bcci.com/ -> Records -> Batting: ALL
Year range ($2) and handling of "*" needs work.
Thanks
AR
...the following...
If $2=(1994-2009) and $9=(1994-2010), then YY=$9
If $2=(1994-2009) and $9=(1992-2007), then YY=(1992-2009)
...Basically the resulting range of years must encompass both ranges specified in field 2 and 9
Handling of * is incorrect. Need as specified in initial request.
Thanks.
Hello,
I need to combine File1 and File2 to result in File3...
File1:
SR Tendulkar,1989-2011,453,18111,200*,48,95,20
RT Ponting,1995-2011,370,13686,164,30,82,20
ST Jayasuriya,1989-2011,445,13430,189,28,68,34
Inzamam-ul-Haq,1991-2007,378,11739,137*,10,83,20
JH...
Thanks for the input. Works great...
However, I do need to take this beyond i=21, i.e., 34, 47, 60, 73, etc.
Basically, it would be i=(8 + (13 * x)), where x=0,1,2,3,4,5,etc.
A quick tip on how to set this up within the awk statement would be awesome.
Thanks
Hello Phil,
Thanks for your input. Got things working with the following...
I have the following javascript code...
document.getElementById('BATS').value = Batsmen;
and the following input html tag...
<input id="BATS" type="hidden" name="userchoice">
and the following MySQL insert via PHP...
Hello,
Continuing the above effort, the full code may be seen at...
http://www.bcci.com/Poll/best_test_batsmen/btb.txt
The polling site is...
http://www.bcci.com/Poll/best_test_batsmen/btb.php
The javascript variable, 'Batsman', is a string and will have a default value of:
"A B C D E F G H...
Hello,
I am putting together the following rank polling for my site...
http://www.bcci.com/Poll/best_test_batsmen/btb.php
The entire code may be viewed here...
http://www.bcci.com/Poll/best_test_batsmen/btb.txt
The following method to assign the value of the javascript variable to PHP...
Thanks Annihilannic for the input...
I came up with the following, which also converts to numeric and then back to the date format after sort.
cat inputfile | \
while read DD; do echo $(date -d "$DD" +%s); done | \
sort -n | \
while read DD; do echo $(date -d @"$DD" +"%a %b %d %Y"); done \
>...
Hello,
Looking for the sort command to sort by date using the following input...
Sun Jan 29 2012
Sun Jan 29 2012
Thu Jan 19 2012
Fri Sep 23 2011
Sat Dec 3 2011
Fri Sep 30 2011
Mon Sep 19 2011
Fri Nov 4 2011
Mon Sep 19 2011
Sat Sep 17 2011
Sat Sep 24 2011
Thanks,
AR
Sat Sep 24 2011
Thanks for your reply. I am building an interactive cricket calendar. Here is a template...
http://http://www.bcci.com/Schedules/Cal.html
The cells where there is no date ('X') is shaded as shown.
Thanks,
Arun
Hello,
I have the following input file...
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Basically it is a monthly calendar (June 2011). I need to fill the blanks with 'X', meaning...
X X X 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.