Menu

'sed' is not recognized as an internal...

Help
reggie27
2011-05-29
2012-07-26
  • reggie27

    reggie27 - 2011-05-29

    I'm no PC jockey. I just use it to get other stuff done, so bear with me. I
    downloaded the GNUWin sed package so that I could run sed at the DOS command
    prompt. When I execute the sed command "sed -e 's/whitesox/White Sox/g' <
    baseball_test_file.txt > baseball_test_file_ja.txt", I get the message:

    'sed' is not recognized as an internal or ext, operable program or batch file.

    The sed.exe file is in a directory path under Program Files. You'd think the
    system would find it. I've been looking at information about changing my
    "Home" values, and a whole bunch of other stuff, but I'm getting nowhere.
    Little help?

     
  • Jay Satiro

    Jay Satiro - 2011-05-29

    You could call the program directly, for example if you have sed.exe in
    "C:\Program Files\gnustuff\bin"

    "C:\Program Files\gnustuff\bin\sed.exe" "s/whitesox/White Sox/g" < in.txt >
    out.txt

    You could instead add the directory where sed and its dependencies (.dll
    files) are located to your system PATH. Your system PATH is a semicolon
    separated list of directories that are searched by the system for programs and
    their dependencies. To see your PATH at the command prompt type

    echo %PATH%

    If sed.exe is "C:\Program Files\gnustuff\bin\sed.exe" for example, you could
    append C:\Program Files\gnustuff\bin to your system path. However by doing
    that anything else in that directory can also be searched by the system. This
    is not always desirable and can lead to compatibility conflicts depending on
    what else is there. I've uploaded a screenshot for GetGnuWin32 users that
    shows how to add to the path.

    You can find it here:

    [url]http://iweb.dl.sourceforge.net/project/getgnuwin32/getgnuwin32/0.6.30/HOWTO_Add_GnuWin32_To_System_Path.png[/url]
    
     
  • reggie27

    reggie27 - 2011-05-29

    Ray, after a bit of stumbling around, playing with single quotes and double
    quotes, and restarting my PC, I got everything you suggested to work. Your
    graphic description for changing the PATH was particularly helpful. I can't
    tell you how much I appreciate your help. Thanks.

     
MongoDB Logo MongoDB