1.

Solve : Bat file to extract first row from several txt files?

Answer»

Hello.

I have SEVERAL .TXT files in the same directory (about 3,000) and I'd need to get a new txt file with 2 data of them. The txt file I need should have 2 columns: the FIRST one with the txt file name and the SECOND one with the first line of every file.

For example:

File: 1.txt
   Peter
   Germany
   Medical

File: 2.txt
  Mary
  Canada
  Teacher

File: 3.txt
  John
  USA
  Engineer

.....

And the file I need should be SOMETHING like:
1       Peter
2       Mary
3       John



Can this be done with MS-DOS?

 
Thanks in advance.Thanks but I've found the way you do it.

Regards.Yep. Pretty easy to do with a single FOR command and an echo command.Nice of him to let us know how he fixed it....



Discussion

No Comment Found