line endings help of non-ASCII files


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users line endings help of non-ASCII files
# 1  
Old 12-07-2010
line endings help of non-ASCII files

When you are dealing with ASCII files it easy to check on line endings type. You can just use the file command. You are not always lucky enough to be dealing with ASCII files. So in the cases that you don't have ASCII files how can you check what type of line endings you have? Please list all methods that you know of.
# 2  
Old 12-07-2010
This doesn't really apply. In unix there are files. They are buckets of bits - nothing else. Period. The file command to some extent is there to keep windows users happy.

The dd command and some other utilities are there to help convert files to something that fits into the unix mindset.

here are some:

channel control words in MVS TSO

fortran carriage control files

VMS carriage control files with line descriptors

prime text files

12 bit byte file with Data General format headers, like "file" VTOC's.

carriage control files with either DOS or unix carriage control

fixed record length files with no carriage control

file descriptor controlled files (not a unix file descriptor, more like docx)

string-delimited files (nul marks the end of a line)

PDL defined files (page description language files like pdf, postscript, and HP PCL) where
records are not actually defined, except maybe by primitives like moveto.

binary files where word lengths or predefined records (structs) define "records".

The list goes on - pointlessly IMO. Any old stinker like me can come up with 'do you remember' file formats. I'd rather forget.

In other words, perhaps you need to rethink file structures. They are something we as people map onto data, the other way around is not really valid. Read the magic man page.
# 3  
Old 12-09-2010
For certain things like shellscripts line endings are VERY important. Shellscripts will only work with LF and not CRLF line endings. I'm sure there are other things but that is the only thing I can think of off the top of my head.
# 4  
Old 12-09-2010
That is not the point - the default carriage-control for unix is unix carriage control - what shell wants. If you use a windows editor with DOS-carriage control to create a unix shell file, then you have problems. If "you don't then you don't" Your choice.

I do not get your point re: your original question. File "types" are kind of an artifact, if you know what that is, of windows. Windows uses file types (extensions) to load applications. Unix developed that (gnome for example) to keep the windows people happy while they were on linux.

I am not assigning value to either position, just pointing out that in 1970's versions of unix it made no difference. Nowadays it does (obviously your post impled it does) - not because of unix so much - but because of windows-think imposed from windows -> unix, brought in by windows first, unix second users. That matches the definition of an articfact - some value induced not by the object itself; rather it is induced by the perception by humans of that object. It is not necessarily an innate property of the object.
# 5  
Old 12-09-2010
Quote:
Originally Posted by jim mcnamara
That is not the point - the default carriage-control for unix is unix carriage control - what shell wants. If you use a windows editor with DOS-carriage control to create a unix shell file, then you have problems. If "you don't then you don't" Your choice.

I do not get your point re: your original question. File "types" are kind of an artifact, if you know what that is, of windows. Windows uses file types (extensions) to load applications. Unix developed that (gnome for example) to keep the windows people happy while they were on linux.

I am not assigning value to either position, just pointing out that in 1970's versions of unix it made no difference. Nowadays it does (obviously your post impled it does) - not because of unix so much - but because of windows-think imposed from windows -> unix, brought in by windows first, unix second users. That matches the definition of an articfact - some value induced not by the object itself; rather it is induced by the perception by humans of that object. It is not necessarily an innate property of the object.
My point is I have a very annoying file that pidgin needs work right. The file kept magically changing on its own. You can read about it here if your curious.
https://www.unix.com/unix-advanced-ex...cal-files.html

I was hoping there was a easy way to check on file endings. File endings are VERY important in certain circumstances.
# 6  
Old 12-10-2010
Pidgin, MSN and X509 certificates are problematic - lots of information on Web about the issues.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Tip to remove line endings and spaces on a pre-formatted text file?

Hi, At the moment, using Notepad++ to do a search and replace, manually section by section which is real painful. Yeah, so copying each section of the line of text and putting into a file and then search and replace, need at least 3-operations in Notepad++. Here's hoping I will be able to... (1 Reply)
Discussion started by: newbie_01
1 Replies

2. Shell Programming and Scripting

Sendmail ignoring line endings

Mails from Sendmail are ignoring line endings, when I try to send email with attachment. I have tried to specify the font in the html but line endings are still ignored. I also tried unix2dos, still no luck. #!/usr/bin/ksh ###Send Email MAILTO=`cat mail2.list | tr -s '\n' ','` SUBJECT="bla bla... (3 Replies)
Discussion started by: aydj
3 Replies

3. UNIX for Advanced & Expert Users

vimrc help with line endings

I was reading this and thought I could put this in my vimrc and it would convert the line endings to unix. Am I doing something wrong or am I missing something? set ff=unixManaging/Munging Line-Endings with Vi/Vim | Jeet Sukumaran I used this command and it confirms that my global option is... (2 Replies)
Discussion started by: cokedude
2 Replies

4. Red Hat

Installing Generic Ascii Drivers For Line Matrix Printer

Hi, Does anybody have any idea as to how to setup a printer using a generic ascii driver? We have a Tally T6100 line matrix printer which is on our network and works fine in a Windows environment. We are trying to move this printer to Oracle Linux. I've contacted Tally as well as Printronix... (0 Replies)
Discussion started by: garethnsolomons
0 Replies

5. UNIX for Dummies Questions & Answers

Find a file that could have different endings

Hello all. Hope you can help. I am looking for a complete command to search for a file named HOSPCHK. The file could be listed with numbers after it like it could be listed with letters after it or a combination of both or just by it self. The other catch is the file that I want to look for... (27 Replies)
Discussion started by: azapp51
27 Replies

6. UNIX for Advanced & Expert Users

Vi line endings conversions

I was reading these 2 articles. Why does the wikia one think :e ++ff=dos? Or am I just misunderstanding it? :e ++ff=unix :e ++ff=dos File format - Vim Tips Wiki Managing/Munging Line-Endings with Vi/Vim | Jeet Sukumaran (1 Reply)
Discussion started by: cokedude
1 Replies

7. Shell Programming and Scripting

Problems with Sed/awk/grep and line endings

Hello I have created the following script, which is designed to manipulate a text document: #!/bin/sh # Get 3 lines, (last of which is "Quantity"); adjust order; put all three on one line with tabs. FILENAME=~/Desktop/email.txt LIST=$(grep -B2 "Quantity" ${FILENAME} |awk 'BEGIN { FS = "\n"; RS... (6 Replies)
Discussion started by: benwiggy
6 Replies

8. Shell Programming and Scripting

New line characters in Ascii file

I am having a file(1234.txt) downloaded from windows server (in Ascii format).However when i ftp this file to Unix server and try to work with it..i am unable to do anything.When i try to open the file using vi editor the file opens in the following format ... @ @ @ @ @ @ @ @... (4 Replies)
Discussion started by: appu2176
4 Replies

9. UNIX for Advanced & Expert Users

create email w/ ASCII attachment via command-line

All, I need to email an ASCII data file to a business partner, and intended on creating a Korn Shell script to create an email message (minimal text), and attach the ASCII data file to the email. It seems this is not as easy as I had thought it might be. sendmail does not support... (3 Replies)
Discussion started by: jwperry
3 Replies

10. UNIX for Dummies Questions & Answers

ASCII Files

Can you pls help on writing ASCII files? For example, how to you put SUPPLIER NO and NAME in an ASCIIfile? (1 Reply)
Discussion started by: yialousa
1 Replies
Login or Register to Ask a Question