Results 1 to 3 of 3

Thread: SED Help!!

  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Question Unanswered: SED Help!!

    Just downloaded sed-Win32 version from WindowsITPro. Created a Windows bat file in order to ftp files to a remote server. The bat file generates a ftp source file. Trying to use sed to add the "put" command in front of each file name in the ftp source file. example:

    My current output
    =============
    open 192.168.1.1
    myusrname
    mypasswd
    hash
    bin
    file1.txt
    file2.txt
    file32.txt
    bye
    ===========

    Desired output
    =============
    open 192.168.1.1
    myusrname
    mypasswd
    hash
    bin
    put file1.txt
    put file2.txt
    put file32.txt
    bye
    ===========

    Then
    c:\>ftp -i -sutput.txt

    Tried several variations of sed command, but with no luck. Windows version lack many of the functions that Unix supports.

    Any suggestions, ideas and help would be greatly appreciated.

    Thanks

    Ron

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    to get you started:

    sed -e 's!.*\.txt$!put &!g' myFile
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  3. #3
    Join Date
    Oct 2004
    Posts
    2
    Thanks,
    command works great on Linux. Now if I can only find a decent Win32 version that supports the command arguments. You pointed me in the right direction anyway. Thanks again.

    Ron

Posting Permissions

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