DOS End character: CRLF Carriage-return line-feed
# Check to see if the file contains CRLF
1. File Dosfile
Back to CRLF
2. Cat-a Dosfile
Back to ^m
# Delete CRLF
: Set Fileformat=unix #: Set Ff=unix
: S/^M//GC # Linux:ctrl+v+m Enter, Aix:ctrl+v ctrl+^ enter
2. Dos2uninx Dosfile
3. COL-BX Dosfile
4. Sed-e ' s/^m//' dosfile
Tr-s "RN" "N" dosfile
Tr-d "R" Dosfile
6. Cat Dosfile | Perl-pe ' ~s//r//g '
Merge files with the dos Copy command (How to eliminate the end of the 1A Terminator).
Recently the company Tenfore Feedhandler project to store a large number of rawdata files. Because the tenforerawdata is very large, the storage policy is to store one RawData file per hour. But when you perform data analysis playback, you want to combine them into a large file. In the beginning is to look for a third-party merging tool on the Internet, after a thought, dos Copy command is not can merge files? Try it now!
For example, you want to combine A.dat and b.dat into C.dat. Among them, the contents of A.dat binary are as follows "30 78 30 33 30 78 30 34", and the contents of the B.dat binary content are as follows, written a DOS script merge.bat, which reads as follows: "Copy a.dat+b.dat C . Dat ".
However, the newly generated c.dat file has the last Terminator "1 A", and the contents of the C.dat file are as follows "1 a".
After the internet to look up the reason, because the copy command by default is the target file and source files are treated as text files, so the newly generated file with the text Terminator "1 a".
The solution is simple, that is, when copying a copy of the binary file.
The new batch process reads as follows: "copy/b a.dat+b.dat c.dat"