Solved Windows equivalent to UNIX 'cat'

February 11, 2013 at 04:31:18
Specs: Windows 7
Hi!
I want to print code files for a training program. I would like to have line numbers in the printout for each file. All files are text files.
On *nix, I can do
cat -n filename >filename.linenos
and then print the filename.linenos file. Is there an equivalent command on DOS/Windows which can allow me to do this?
Thanks!
~ rajeev
NOTE: Despite what the title says, what I need is the equivalent of the UNIX 'cat' command on Windows.

edited by moderator: Fixed title -Razor2.3


See More: Windows equivalent to UNIX cat

Report •


#1
February 11, 2013 at 05:31:49
✔ Best Answer
type filename.txt | find /V /N "" > filename.lst

Report •

#2
February 11, 2013 at 05:35:09
If your more comfortable using the NIX commands, try here:

http://unxutils.sourceforge.net/

I keep a copy handy for when I need them.

MIKE

http://www.skeptic.com/


Report •

#3
February 11, 2013 at 09:00:59
Got error 403 while accessing the .zip file. Probably because the directory display has been disabled -- as the error page mentioned. Could not figure out how to enable the same while access the site from windows. Anyone figure out how to get UnxUtils.zip?
~ rajeev

Report •

Related Solutions

#4
February 11, 2013 at 09:50:20
I just downloaded and unzipped on my Win 7

MIKE

http://www.skeptic.com/


Report •

#5
February 11, 2013 at 20:35:20
Hi mmcconaghy,

Did you just left-click on the UnxUtils.zip file to download?
When I do so, I get the screen:
++++++++++++++++++++++++++++++++++++++++++++++++++
An error has been encountered in accessing this page.

1. Server: unxutils.sourceforge.net
2. URL path: /UnxUtils.zip
3. Error notes: NONE
4. Error type: 403
5. Request method: GET
6. Request query string: NONE
7. Time: 2013-02-12 04:32:32 UTC (1360643552)

Reporting this problem: The problem you have encountered is with a project web site hosted by SourceForge.net. This issue should be reported to the SourceForge.net-hosted project (not to SourceForge.net).

If this is a severe or recurring/persistent problem, please do one of the following, and provide the error text (numbered 1 through 7, above):

Contact the project via their designated support resources.
Contact the project administrators of this project via email (see the upper right-hand corner of the Project Summary page for their usernames) at user-name@users.sourceforge.net
If you are a maintainer of this web content, please refer to the Site Documentation regarding web services for further assistance.

NOTE: As of 2008-10-23 directory index display has been disabled by default. This option may be re-enabled by the project by placing a file with the name ".htaccess" with this line:

Options +Indexes
++++++++++++++++++++++++++++++++++++++++++++++++++

Sorry if I am being very dumb somewhere.....
~ rajeev


Report •

#6
February 11, 2013 at 20:36:32

BTW, thanks IVO, for a simple answer.

It solves my problem, but I am still interested in the UnxUtils.zip file...

~ rajeev


Report •

#7
February 11, 2013 at 23:44:31

Report •

#8
February 12, 2013 at 06:24:35
You know, if you're going to regularly use the Windows environment, it might behoove you to learn it instead of trying to import your old, albeit familiar, environment.

Windows has three different scripting sets, so you might want to pick another one if batch isn't receptive to your needs. (It rarely is.)

How To Ask Questions The Smart Way


Report •

#9
February 12, 2013 at 07:00:20
Thanks, Mechanix2Go, for the link.
Was able to download and unzip UnxUtils.zip.
Will now set it up, to use all the executables.

Razor2.3, do you mean DOS and PowerShell? Which is the 3rd scripting set?
I merely wanted a quick way of getting my task done.

~ rajeev
"The technocrats of today are like little children! -- amusing themselves with inventing a new Tablet here, a new hadoop there.... -- while the real problems of the Common Man lie untouched, and grow more acute..."


Report •

#10
February 12, 2013 at 07:44:22
VBScript / JScript. The former resembles a stripped-down version version of VBA (itself resembles a stripped-down version of VB6). The latter resembles JavaScript.

Batch is the only one with a shell associated with it, but it's also the worst with anything resembling data manipulation. What are attempting?

How To Ask Questions The Smart Way


Report •

#11
February 13, 2013 at 01:27:24
AOT [almost on topic]

Is there an NTVDM widget for unix?

=====================
M2 Golden-Triangle


Report •

#12
February 13, 2013 at 05:23:10
Wine is pretty much the answer to any Windows related question on Linux, so I'd start there.

How To Ask Questions The Smart Way


Report •

Ask Question