Search Results

Search: Posts Made By: me_newbie
3,923
Posted By Corona688
Apologies for not noticing the updated question,...
Apologies for not noticing the updated question, I was answering your OP...

You still haven't told us what shell you use. It would be a lot easier to answer if you told us what shell you use. As...
3,923
Posted By vgersh99
try replacing ':' as as well as '/' ...
try replacing ':' as as well as '/'

mydate_converted=`echo "$mydate" | sed 's#[/:]# #g'
3,923
Posted By MacMonster
Replace the slashes with spaces. ...
Replace the slashes with spaces.


mydate="22/Oct/2011"
mydate_converted=`echo "$mydate" | sed 's/\// /g'`
mydate=`date -d "$mydate_converted" +%s`
1,418
Posted By birei
Hi me_newbie, A possible solution using...
Hi me_newbie,

A possible solution using 'perl':

$ cat infile
---some text---- 01/Jan/2010 ---- some other text ----
---some text---- 10/Jan/2010 ---- some other text ----
---some text----...
1,418
Posted By Shell_Life
#!/usr/bin/ksh typeset -i mI set -A mMon n/a...
#!/usr/bin/ksh
typeset -i mI
set -A mMon n/a Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
mFrom='20100105'
mTo='20110101'
while read mLine; do
echo ${mLine} | sed...
2,111
Posted By rdcwayx
tail -1 filename
tail -1 filename
2,111
Posted By vgersh99
sed -n '$p' myFile
sed -n '$p' myFile
2,111
Posted By bartus11
Try: awk 'END{print $0}' file
Try: awk 'END{print $0}' file
1,907
Posted By radoulov
Yes, -t/ - fields are delimited by forward...
Yes,

-t/ - fields are delimited by forward slash(es) `/'

then in order:

-k3n - sort numerically by the third field
-k2,2M - sort by month considering only the second field
(not from the...
1,907
Posted By radoulov
sort -t/ -k3n -k2,2M -k1n infile
sort -t/ -k3n -k2,2M -k1n infile
1,907
Posted By Corona688
There is indeed: awk 'BEGIN { #...
There is indeed:

awk 'BEGIN {
# Set up arrays for name-to-monthnumber
split("Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec", MON, "|");
for(N=1; N<=12; N++)...
1,219
Posted By ygemici
we must firstly use the sort command, because of...
we must firstly use the sort command, because of uniq command process for sequential lines.therefore we use firstly sort command for get the sequential lines.
# cat file
a b
b c
a b
d c
a b
a...
1,219
Posted By ygemici
how about your input file? maybe you can try...
how about your input file?
maybe you can try like this.(while FS is space!)
$ cut -d" " -f1 file_name|sort|uniq -c|sed 's/ *\(.*\) \(.*\)/\2 \1/'

regards
ygemici
2,374
Posted By Corona688
That's just a simplified version of what you...
That's just a simplified version of what you already did...

awk '{ C[$1]++; }
END { for(K in C) print K, C[K]; }'
2,374
Posted By Corona688
Please don't bump. -F tells awk what to use...
Please don't bump.

-F tells awk what to use as a separator -- where fields stop and start. It's a regular expression. Any single , . ? \ ! will stop the current record and start the next.

...
2,374
Posted By ourned
it works fine... thanks everyone hats off to...
it works fine... thanks everyone

hats off to itkamaraj
Showing results 1 to 16 of 16

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