Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: best language to perform string operations

  1. #1
    Join Date
    Aug 2012
    Beans
    623

    best language to perform string operations

    Hello,
    I frequently run into problems where I have to get some input from a text file, do some string operations on it, and then write it back to the file.
    As of now, I am doing this in C, but I feel this is consuming too much of my time since I have to implement everything from scratch.

    While it makes for very good learning, it's sometimes difficult when I'm in a hurry.

    Which language would you advise me for this purpose.
    Thanks.

  2. #2
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: best language to perform string operations

    What kind of string operations?
    perl is the king of everything string related, python is ok too. Easy tasks can be done with awk, sed.
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  3. #3
    Join Date
    Aug 2012
    Beans
    623

    Re: best language to perform string operations

    Quote Originally Posted by Vaphell View Post
    perl is the king of everything string related, python is ok too. Easy tasks can be done with awk, sed.
    Ok shall keep that in mind.[/quote]

    What kind of string operations?
    Mainly like, extracting a part of a string from a huge string.

  4. #4
    Join Date
    Feb 2009
    Beans
    1,469

    Re: best language to perform string operations

    Perl. It takes a bit of time to learn but it makes some things so easy.

    Learning Perl is the best introductory programming text ever IMO, so if you get a book, make it that one.

  5. #5
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: best language to perform string operations

    Perl is indeed the best language for text-related operations, but very often a one-liner shell script with the standard tools is enough.
    「明後日の夕方には帰ってるからね。」


  6. #6
    Join Date
    Mar 2006
    Beans
    393

    Re: best language to perform string operations

    Perl. Perl has the most advance regular expression engine. So advance that Python uses it too.
    Just my 0.00000002 million dollars worth,
    Shawn

    Programming is as much about organization and communication as it is about coding.

  7. #7
    Join Date
    Sep 2011
    Beans
    86
    Distro
    Ubuntu

    Re: best language to perform string operations

    Ruby or Perl. Ruby has all of Perl's regex features, many built-in methods you can perform on strings, and is quite user friendly too. It also has pattern matching, blocks, and other useful functions. I've heard Perl is very powerful for this kind of thing too, but I don't know it very well (just the Perl-inspired bits in Ruby).

  8. #8
    Join Date
    Mar 2006
    Beans
    393

    Re: best language to perform string operations

    Quote Originally Posted by Mikeb85 View Post
    Ruby or Perl. Ruby has all of Perl's regex features, many built-in methods you can perform on strings, and is quite user friendly too. It also has pattern matching, blocks, and other useful functions. I've heard Perl is very powerful for this kind of thing too, but I don't know it very well (just the Perl-inspired bits in Ruby).
    FYI: Ruby also uses Perl's regular expression engine.
    Just my 0.00000002 million dollars worth,
    Shawn

    Programming is as much about organization and communication as it is about coding.

  9. #9
    Join Date
    Nov 2007
    Beans
    2

    Re: best language to perform string operations

    I would like to know how important speed is when it comes to these string operations, or is it about how easy it is to edit this code.

  10. #10
    Join Date
    Aug 2012
    Beans
    623

    Re: best language to perform string operations

    Thanks a lot for the replies. The unanimous answer sounds like Perl, I shall get a book and start learning. It will be very helpful for me.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •