Can we print any string in reverse order?
For example:
oracle 16294 1 0 Aug 11 ? 0:00 ora_reco_crepd
oracle 16276 1 0 Aug 11 ? 0:19 ora_dbw0_crepd
I need second last column from this output. (0:00 & 0:19).
I can use awk print $2 after reversing the string.
... (4 Replies)
How to get the reverse parsing work.
I have a strings like
aqw-wef-324-err.log
wefd-324r-err.log
efrt-4rfr.log
.
.
i want to have string upto last hypen.
aqw-wef-324
wefd-324r
... (1 Reply)
Hi,
I am very new to perl.
My question:
How i can reverse the given string using substr function but without using reverse function in perl?
Anybody please help.
thanks,
-Lalit (3 Replies)
I have a file like this:
Dog Cat One ABCDEFGHIJ house
Dog Cat Two ABCDEFGHIJ house
Cat Cat One ABCDEFGHIJ house
Cat Cat Two ABCDEFGHIJ house
I want to look at $3 and if it says "Two" print out the line except reverse $4.
Dog Cat One ABCDEFGHIJ house
Dog Cat Two JIHGFEDCBA house ... (3 Replies)
Guys,
I am trying to find a way to achieve this. I need to print /usr/local/apche/htdocs only from the string /usr/local/apache/htdocs/file.php using the regex. The below did not work. I know a solution with normal cut, I need a way to do this with the awk regex.
awk '/+file.php/' (6 Replies)
Hi All,
I have a String str="Manish". I would like to reverse it.
I know the option to do this in bash is: echo "Manish" | rev
but I have seen an alternate solution somewhere, which states that:
str="Manish" echo $str | awk '{ for(i=length($0);i>=1;i--) printf("%s",substr($0,i,1));... (7 Replies)
Hello,
Can anyone explain for me in this script to reverse the string?
1) the "x=x" part, how it works?
$ echo welcome | awk '{ for(i=length;i!=0;i--)x=x substr($0,i,1);}END{print x}'
$ emoclew2) x seems to be an array at the END, but can it automatically print the whole array in awk?
Thanks... (8 Replies)
Hi,
how to cut part of a string sing delimiter in reverse
input file
1,2,st-pa-tr-01,2,3,4,
2,3,ff-ht-05,6,7,8
how can i obtain strings till
st-pa-tr
ff-ht i.e cutting the last part og string -01 and -05
Thanks & Regards
Nivi
edit by bakunin: changed thread title (typo) (3 Replies)