Output the contents of any extension file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ladduq
Posts: 31
Joined: 22 Jan 2012 01:08

Output the contents of any extension file

#1 Post by ladduq » 06 Mar 2012 06:57

Please help

Need to output the contents of any extension
file line by line.
Different extension files like
.PDF
.XML
.HTML
.DOC
not only these, any extension file contents should be displayed line by line.


If any file displays the content in some unknown symbols like binary 0's and 1's or like class file.Firstly it should be converted to string format and then out put the string formated content.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Output the contents of any extension file

#2 Post by foxidrive » 06 Mar 2012 12:35

Maybe you want to find readable text in various files - peek.com was a utility back in the bad old days to do that. You might find it or a more modern implementation in google.


Code: Select all

*
*   PEEK
*
*   reads the text parts of any  file, even  with  extensions like
*   EXE, COM, OVR, OBJ, HLP, BAS,  BIN,  DEF,  FMT,  DBF, SYS etc.
*   It will also read text files: TXT, DOC, DAT, LST etc.
*   It ignores graphic characters and omits empty lines.
*
*   Correct syntax is    PEEK [/p] filename.ext [>newfile.ext]
*
*   Optional switches:   /p  displays one screen at a time
*   (may be anywhere   /w  forces WordStar interpretation
*   on command line)       (normally automatic)
*
*   The output  may be  redirected  into a disk file ( newfile.ext
*   above ) and edited and/or printed out.
*   If you have forgotten what  a program does, or its syntax, you
*   will generally find in the PEEK output:
*      1) The origin and author of the program
*      2) Any Help messages
*      3) Clues to syntax, special switches, etc.

*   Jan Machacek                    Autelco Ltd., 103 London Road,
*   March 1989                      Staines, Middx.       TW18 4HN

ladduq
Posts: 31
Joined: 22 Jan 2012 01:08

Re: Output the contents of any extension file

#3 Post by ladduq » 08 Mar 2012 22:23

@foxidrive

Hi

Thank you for replying.

can u please explain a little bit more like how to execute the command
I use windows operating system.How can i get file contents in a windows OS

is it a dos command.i'm unable to execute it from command prompt it says
peek is not recognized as an internal or external command.

Thanks & Regards
Ladduq

Liviu
Expert
Posts: 470
Joined: 13 Jan 2012 21:24

Re: Output the contents of any extension file

#4 Post by Liviu » 08 Mar 2012 23:28

ladduq wrote:Need to output the contents of any extension file line by line.

"Any" is a big word ;-) What would you expect a JPEG file "line by line" output to look like, for example? Even text formats are not necessarily line oriented, think lists/tables/annotations.

To extract the "raw text" from a supported format, you may install a "Generic / Text Only" printer, and print to it from the application that supports the given format.

To just dump all (possible) embedded text, google a peek-like utility, like foxidrive suggested. To search for specific text in a file use for example http://technet.microsoft.com/en-us/sysi ... s/bb897439.

Liviu

Post Reply