LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-20-2010, 12:14 PM   #16
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by rkelsen View Post
Text is text. It isn't proprietary.

The only difference is that DOS/Windows text files use ^M to represent a line feed. Unix/Linux ones don't.
Again, I'd prefer to use a native Linux app rather than run a Windows one in Wine, otherwise what is the point?

I understand that text is text... and the line-feed issue. However, with some of the files here is what I get with gedit:

Code:
gedit has not been able to detect the character encoding.
Please check that you are not trying to open a binary file.
Select a character encoding from the menu and try again.

My choices for encoding are UTF-8, ARMSCII-8 or ISO-8859. None of them work. I'd be happy if I could figure out what hte problem is and run some sort of shell script to fix this on new files being downloaded. Then I could just stick with gedit.

The files open just fine if I boot to Windows and/or use Gvim in Linux. The main drawback to GVIM is the clipboard issue.

However, it looks my issue the clipboard problem referred to in this thread. At least now I know what is happening.

Last edited by crokett; 08-20-2010 at 12:18 PM.
 
Old 08-20-2010, 02:50 PM   #17
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15
Ok, I found something interesting. I have a text file (can open with a text editor), can cat it and do all the other stuff with it but linux thinks it is a data file. That probably explains why gedit can't open it.

strings command did not work. od did not work. Any other ideas?

Last edited by crokett; 08-20-2010 at 03:01 PM.
 
Old 08-20-2010, 02:59 PM   #18
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Linux doesn't think it's a binary file. In fact Linux doesn't think anything about file contents!

It's the desktop/file manager/gedit that does.
 
Old 08-20-2010, 03:19 PM   #19
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15
Code:
$ file new\ dir1.txt
$ new dir1.txt: data
Code:
$ dos2unix new\ dir1.txt. 
$dos2unix: Skipping binary file new dir1.txt

Nautilus says it is a text file. gedit won't open it. gvim will.
 
Old 08-20-2010, 03:26 PM   #20
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
What does "new\" mean???
 
Old 08-20-2010, 03:31 PM   #21
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15
filename is "new dir1.txt"

"new\ " means the "\" is an escape character to say there is a space there. I could run the same command but put everything in quotes if I wanted to. The tab key just autofills the "\"
 
Old 08-20-2010, 03:57 PM   #22
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
It's still dos2unix, not the Linux OS, that thinks it's a binary file.

Does the file have executable permissions? Maybe that makes dos2unix think it's a binary?
 
Old 08-20-2010, 05:22 PM   #23
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
it might be the "windows" mount permissions
i am working out the kinks in a suse11.3 centos 5.5 and win7 system

the MS vs c++ redis. elua text files ARE +x 777 ( on the win drive)
and gnome says "open or run"
gedit : opens them as a normal formatted text file
emacs : as a normal formated doc, with the ^m tags
ViM : as a normal formated text doc ,WITHOUT the ^m tags

Nano : fubars it
Vi : opens it just fine

why the need for dos2unix
and why " new\ dir1.txt " -- why the space ?
you can just quote it "new test file.txt" or NewTestFile.txt , new_test_file.txt
 
Old 08-20-2010, 09:30 PM   #24
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15
space is there cuz that is what the customer named it. I don't bother renaming all the files I get. it would take too much time. I know I can quote it, but tab key autofills the \ when there are spaces in a filename. It turned out to be a null character at the start of the file. running it through the strings command fixed it. I think I screwed the command up when I tried it earlier today.

now I will just start using gedit and run strings if I need to.

was trying dos2unix to see what it could do with the file.

Last edited by crokett; 08-20-2010 at 09:31 PM.
 
Old 08-20-2010, 09:41 PM   #25
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
It's really better to pick an editor that can switch between DOS type mode and UNIX type mode with reference to the current file being open. Using dos2unix may be a way to edit a file in a UNIX-only editor but what if you'll use the file again in windoze? Don't you think you'll have to use unix2dos to put it back again?
Quote:
Originally Posted by crokett View Post
Again, I'd prefer to use a native Linux app rather than run a Windows one in Wine, otherwise what is the point?
The point of?
 
Old 08-20-2010, 10:09 PM   #26
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15
The point of running Linux if you are just going to clutter it up with windows apps? Unless of course there aren't any alternatives for what you need to run.

As for dos2unix, that was just a test to see if it could do anything with the file. It couldn't.
 
Old 08-20-2010, 10:52 PM   #27
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by crokett View Post
The point of running Linux if you are just going to clutter it up with windows apps?
I see no problem with that. Does all of Linux become windows when you do that? What do you mean clutter it up? It's installed properly just like other apps. That doesn't make sense. Or is it that you just consider windows apps as dirt?
Quote:
Originally Posted by crokett View Post
Unless of course there aren't any alternatives for what you need to run.
Of course but not unless you wanted something with same functionality as your favorite editor.. like me wanting Notepad++.
Quote:
As for dos2unix, that was just a test to see if it could do anything with the file. It couldn't.
Have you tried it with VIM?
 
Old 08-20-2010, 11:09 PM   #28
crokett
Member
 
Registered: Feb 2003
Distribution: Fedora 13
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by konsolebox View Post
I see no problem with that. Does all of Linux become windows when you do that? What do you mean clutter it up? It's installed properly just like other apps. That doesn't make sense. Or is it that you just consider windows apps as dirt?
Of course but not unless you wanted something with same functionality as your favorite editor.. like me wanting Notepad++.
Have you tried it with VIM?
No. But I'm of the mind that if I am running Linux I will try to run native apps. I have a Windows text editor I like too. I also have a native linux one that provides the same functionality and runs much faster, especially with the 25MB+ text files I frequently work with. So if I can get the same functionality in a native linux app, why bother installing wine? To each his own I guess. By the same token I haven't installed Cygwin in Windows to get linux functionality. If I want Linux I boot to Linux.

GVIM opens the files just fine, it just has issues with the clipboard. Gedit can't open the files, but doesn't have the clipboard issues.
 
Old 08-21-2010, 02:40 AM   #29
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,446
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by crokett View Post
Again, I'd prefer to use a native Linux app rather than run a Windows one in Wine, otherwise what is the point?
I think you misread me. The application I suggested (Mousepad) is a native Linux program.

Since making the suggestion to you yesterday, I've found that it has the ability to "Save As" DOS-compatible text files (CR+LF).
 
Old 08-21-2010, 03:14 AM   #30
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
@crokett I think that sometimes you need to be more flexible but I respect your methods.
 
  


Reply



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
[SOLVED] All text in text editor turned to boxes... unclerick94 Linux - Newbie 2 07-17-2009 04:14 PM
text selection question in text editor olin Linux - Software 1 09-25-2007 01:25 PM
text editor Gortex Programming 12 11-01-2006 10:33 PM
Text Editor on Fedora Core 4 in Text Mode blong4life Linux - Software 5 07-31-2006 09:07 PM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM

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

All times are GMT -5. The time now is 05:15 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
Open Source Consulting | Domain Registration