wc -l

 4 Replies
 2 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Srini Rao
Veteran Member
Posts: 149
Veteran Member

    Hello - I need to find the line count for a text file process flow.

     

    I used the syscommand node and used the following command,

     

    wc -l filename.txt.

     

    I tried the execution mode as run cmd.exe and automatic. We are on Windows.

     

    It fails with following error..

     Executing System Command Activity SysCommand9810...
    Full system command: cmd.exe /C wc -l  D:\Interface\Srini.TXT
    Command output (combined): 'wc' is not recognized as an internal or external command,
    operable program or batch file.
    Command error output: 'wc' is not recognized as an internal or external command,
    operable program or batch file.
    SysCommand9810_errorOutput = 'wc' is not recognized as an internal or external command,
    operable program or batch file.

     

    Please Advise

    Rick McCahan
    Basic Member
    Posts: 13
    Basic Member

      Srini,

       

      You need to install wc.exe on the Landmark server and provide the full path to it in the SysCommand node.  On our server that would be

      d:\Cygwin64\bin\wc -l

      Shane Jones
      Veteran Member
      Posts: 460
      Veteran Member
        I don't have time to check but I bet the data iterator node would be able to return a record count from a file.

        Shane Jones
        Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
        Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
        ** Teach others to fish...
        Srini Rao
        Veteran Member
        Posts: 149
        Veteran Member
          Thanks
          Shane Jones
          Veteran Member
          Posts: 460
          Veteran Member
            I just checked and data iterator should be able to return what you need.

            Add data iterator node
            Input method = file
            Input file = unc path to the file
            Parse by = line

            Use "nodename_recordNumber" after the node and it gives the lines in the file.
            Shane Jones
            Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
            Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
            ** Teach others to fish...