Search:

Type: Posts; User: kurum!; Keyword(s):

Page 1 of 3 1 2 3

Search: Search took 0.03 seconds.

  1. Replies
    5
    Views
    675

    Re: Bash uppercase after {. ! ?}

    # echo "hello. my name is newbe.can u help me?" | ruby -e 'puts gets.split(/\s*\.\s*/).map(&:capitalize).join(". ") '
    Hello. My name is newbe. Can u help me?
  2. [SOLVED] Re: Regular expressions: Extract several items from a line of text

    Just use split on ":" and get the 2nd item. Simple, and doesn't take days to solve
  3. Replies
    15
    Views
    2,941

    [SOLVED] Re: awk regular expressions: \1

    what do you want to prove? you are not even realistic.


    So is a whole bunch of unreadable symbols .
  4. Replies
    15
    Views
    2,941

    [SOLVED] Re: awk regular expressions: \1

    regex is not the only way to solve the problem. regex are just string manipulation. awk is good enough to solve most common string manipulation without regex.
    regex is just a convenience. If you...
  5. Replies
    15
    Views
    2,941

    [SOLVED] Re: awk regular expressions: \1

    Proof of concept.



    # echo 'abba' | awk '{a=$0; b=gensub(/(.)(.)/,"\\2\\1","g"); c=gensub(/(.)(.)/,"\\2\\1","g",b); if (c==a) print "match"}'
    ok
  6. Replies
    15
    Views
    2,941

    [SOLVED] Re: awk regular expressions: \1

    wrong
  7. Replies
    11
    Views
    880

    [SOLVED] Re: printing certain lines from a file

    ruby -ne 'puts $_ if $.>=30 && $.<=35' file
  8. Replies
    11
    Views
    880

    [SOLVED] Re: printing certain lines from a file

    # ruby -ne 'puts $_ if $.>=30 && $.<=35' file
  9. Replies
    10
    Views
    833

    [SOLVED] Re: Regular expression question

    # echo "deed" | ruby -e 'puts gets.chomp.split("").uniq.size'
    2
    # echo "aaaa" | ruby -e 'puts gets.chomp.split("").uniq.size'
    1
  10. Replies
    10
    Views
    7,615

    Re: Python - Extracting data from text file

    To OP, you can split on the word "snRate:". This is how i do it in Ruby



    File.open("file").each do |line|
    puts line.split("snRate:")[1].strip if line[/snRate/]
    end
  11. Replies
    10
    Views
    7,615

    Re: Python - Extracting data from text file

    sometimes, the easiest way is without regular expression.
  12. Re: sed | awk | sed the propper way to do it please.

    So, here's doing it with only one awk command


    awk '!/^Start|^Commandl|^End|^Upgrade:|^Error:/ { gsub( /\([^()]*\)/ ,"" );gsub(/ ,/," ");sub(/^Install:/,""); print}' history.log
  13. Replies
    12
    Views
    463

    Re: Regular expression in perl

    I don't use Perl,



    $ for text in ppxppy ppxppyfpp asdpperdspp asp aspp aspppas apppasspp asppppass ;
    >do
    > echo $text | ruby -ne 'chomp;puts ($_.split(/[^p]/).grep(/.*pp.*/).size == 2) ?...
  14. Replies
    5
    Views
    313

    [SOLVED] Re: Remove first part of a result

    $ ruby -ne 'print $_.gsub(/\/.*\//,""); ; ' file
    Waffle
    bin
    Settings.app
    SpringBoard.app
  15. [SOLVED] Re: Python - Simple method of detection file changes

    Search google for AIDE (intrusion detection). Or pyInotify
  16. Replies
    14
    Views
    466

    Re: parsing text file in cli

    you do know that Perl switch -n can simulate going through a file using a while loop right? Also, why the need to call external commands? If you want to use Perl, then use its features that are...
  17. Replies
    14
    Views
    466

    Re: parsing text file in cli

    *duplicate*
  18. Replies
    14
    Views
    466

    Re: parsing text file in cli

    you can get the return output like this inside awk.


    command="my command"
    command |getline output
    print output
  19. Replies
    14
    Views
    466

    Re: parsing text file in cli

    this would not really do the trick
  20. Replies
    14
    Views
    466

    Re: parsing text file in cli

    I don't even understand your pseudocode (which should be as english as possible) especially the someexternalcommand part. Show your desired output and describe clearly your problem again.
  21. Replies
    2
    Views
    847

    Re: how to remove files older than some date

    You can also use a language , eg Ruby


    Dir["*"].each do |file|
    mtime=File.stat(file).mtime.to_s.split[0]
    puts file if mtime < '2011-04-10'
    end
  22. Replies
    6
    Views
    470

    Re: print Python list ??

    that is correct and should be the way if one wants to live in Python land.
  23. Replies
    6
    Views
    470

    Re: print Python list ??

    use join()
  24. Re: C vs C++ vs Perl vs Python vs C#... Which one should i chose?????

    i did not say you can't do all these with C++. The question is are the normal users going to be programming applications like that? No, they will be busy with data gathering, file/report formatting,...
  25. Re: C vs C++ vs Perl vs Python vs C#... Which one should i chose?????

    You are spouting rubbish again. Have you read my statement? I said code written in one language can run on another platform with the same language. You talk about .NET, now you find me VB compiler...
Results 1 to 25 of 62
Page 1 of 3 1 2 3