![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting end of line $ character in file | bwrynz1 | UNIX for Advanced & Expert Users | 3 | 01-08-2008 09:17 AM |
| Deleting lines above a certain line | eltinator | Shell Programming and Scripting | 3 | 10-11-2007 11:29 AM |
| Deleting First Two Characters On Each Line | scotbuff | Shell Programming and Scripting | 5 | 12-15-2006 09:03 PM |
| Checking the last line and deleting | srivsn | Shell Programming and Scripting | 3 | 12-13-2005 10:04 AM |
| Deleting end line spaces for along file | osymad | Shell Programming and Scripting | 3 | 02-23-2005 09:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Deleting UNIX End of Line Chachracter \000
Hi,
I have this file which has some octal NULL characters (\000). I need to replace these characters with an ASCII NULL. I've tried using Perl, the UNIX tr command.. History of this I received a COBOL generated file, ran the od command to convert to a xxx byte per record file. Now, some of the records that have octal NULLS wont convert and it merges the next line to this record with the current line. I found this at http://www.canberra.edu.au/~sam/whp/sed-tricks.html Type in a text file named "f127.TR" with the line starting tr above. Print the file on screen with cat f127.TR command, replace "filein" and "fileout" with your file names, not same the file, then copy and paste the line and run (execute) it. Please, remember this does not solve Unix end-of-file problem, that is the character '\000', also known as a 'null', in the file. Nor does it handle binary file problem, that is a file starting with two zeroes '\060' and '\060' http://www.canberra.edu.au/~sam/whp/sed-tricks.html Any idea how I could do this in UNIX without using C or a different programming language. Thanks, U |
| Forum Sponsor | ||
|
|
|
||||
|
An ascii null is represented by octal \000 so your question is senseless. Your reference that you quoted even mentions this:
the character '\000', also known as a 'null' So you want to convert \000 to nulls? Good news! You're done. |
||||
| Google The UNIX and Linux Forums |