Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example say I have a file called testfile.txt that contains a list of file names of the following format:

A       svn\New Text Document.txt
M       svn\Table_tblVersion.xml

Is there a command that I can pipe testfile.txt into such that the first 8 characters of each line is removed. The output I want is simply:

svn\New Text Document.txt
svn\Table_tblVersion.txt
share|improve this question
    
I think that you may find the answer in this topic. – Jack Shainsky May 5 '11 at 9:39
    
It looks like windows command-line is not well suited for this task. Luckily I have the option of doing what I want in vb, so I'll be doing that instead I think! – David May 5 '11 at 10:15

You need to run the for command against the file contents:

for /f "tokens=1*" %a in (testfile.txt) do echo %b

It's nowhere near as versatile as cut in GnuWin coreutils, but it works.

share|improve this answer
    
variable names don't match, otherwise works good – Sahuagin Sep 13 '15 at 19:40

I really recommend Powershell for such tasks. It's integrated with Windows 7 and you can download it for older versions of Windows.

The command is:

get-content testfile.txt | ForEach-Object {$_.Substring(8)} | write-host
share|improve this answer

Step 1. Install Cygwin, UnxUtils or GnuWin32

Step 2. cut -c9-99 testfile.txt

If you must use a pipe: cat testfile.txt | cut -c9-99

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .