LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-09-2008, 03:22 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 57
how to convert bin like to text ?


Hello

I have a file without LR LF, and linux thinks that it is a bin.
How can I format it so that I can cat/read it?

thanks
 
Old 09-09-2008, 03:45 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
It seems that anything other than plain text has some kind of signature at the beginning. Is that not what Linux uses to decide how to read a file?

Try doing "cat filename|hexdump -C|more" to see what's actually there.
 
Old 09-09-2008, 03:52 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Some text editors will allow you to read a binary file, others won't. I know gedit will not display a binary file. I know that kwrite and mped will display a binary file.

The best editor choice is probably ghex. ghex displays any file both as hexadecimal and ascii and allows you to edit it either as hexadecimal or as ascii.

http://rpmfind.net/linux/RPM/dag/red....dag.i386.html

--------------------
Steve Stites
 
Old 09-09-2008, 10:29 PM   #4
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,006

Rep: Reputation: 168Reputation: 168
If you just want to read the file goto a terminal and run mc (midnight commander)
navigate to the file highlight it then hit F3
 
Old 09-10-2008, 07:38 AM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
How about
Code:
strings binfile > readablefile
?
 
Old 09-10-2008, 08:00 AM   #6
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
If it is just a DOS text file with CRLF line-endings, this simple command will transform it into a Unix texe file (LF line-endings):

tr -d '\r' </path/to/DosTextFile >/path/to/new/UnixTextFile

Yves.
 
Old 09-10-2008, 07:55 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,396

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Try dos2unix
 
Old 09-11-2008, 05:08 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Having asked his question, and received 6 useful replies, the OP has left this thread to ask other questions:
http://www.linuxquestions.org/questi...d.php?t=668700
http://www.linuxquestions.org/questi...d.php?t=668746
 
Old 09-11-2008, 12:30 PM   #9
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by tredegar View Post
Having asked his question, and received 6 useful replies, the OP has left this thread to ask other questions:
http://www.linuxquestions.org/questi...d.php?t=668700
http://www.linuxquestions.org/questi...d.php?t=668746
nonono, didnt come to it yet... I look at it next week. That's WEEKEND !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DOS text files to UNIX text files ta0kira Linux - Software 7 03-15-2011 11:42 AM
Steps needed to convert multiple text files into one master text file jamtech Programming 5 10-07-2007 11:24 PM
How i convert bin package to rpm voodoo_tux Linux - Software 1 09-06-2006 12:24 PM
how to convert text into sound. dr_zayus69 Linux - Software 10 06-28-2005 06:49 PM
mounting bin/cue images without convert to iso? Moebius Linux - Software 1 12-05-2004 05:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration