08-12-2003
unix2dos is not universally available. Check out the man page for "tr", especially the "-d" option.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello I'm trying to write a shell script which can remove a carriage return and/or line feed from a file, so the resulting file all ends up on one line.
So, I begin with a file like this
text in file!<CR>
line two!<CR>
line three!<CR>
END!<CR>
And I want to end up with a file... (1 Reply)
Discussion started by: tbone231
1 Replies
2. Shell Programming and Scripting
I am doing some edi where translations had to be run on unix. Generally when I run the translations on windows, the output file has both carriage returns and line feed where as when ran on unix will have only line feed. I need to insert carriage return before the line feed. Is there some tool... (2 Replies)
Discussion started by: huey ing
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a situation where I need to remove the carriage return between the lines.
For.eg.
The input file:
1,ad,"adc
sdfd",edf
2,asd,"def
fde",asd
The output file should be
1,ad,adc sdfd,edf
2,asd,def fde,asd
Thanks
Shash (5 Replies)
Discussion started by: shash
5 Replies
4. Shell Programming and Scripting
Hello everyone,
I am trying to search a file for lines that start with 'ip:' and have a carriage return after(ip:$). I then want to remove the carriage return from that line and append the next line in the file to the line containing 'ip'. I tried doing this with SED, but had no luck. Any... (3 Replies)
Discussion started by: vada010
3 Replies
5. Programming
I keep running into the same problem with the following script. Every time it prints the carrage (line feed) char when I test. I believe that the issue is in the group by but I do not see it. The code is as follows.
SET FEED OFF
SET ECHO OFF
SET HEADING OFF
SET LINESIZE 1000
SET PAGESIZE... (1 Reply)
Discussion started by: sherrod6970
1 Replies
6. Shell Programming and Scripting
Hi All,
I am reading two files and writing out the file name and count of lines in each file to an output file.
My script looks like this:
echo "input_file1.out;`wc -l < input_file1.out | sed 's/^]*\(.*\)]*$/\1/'` " > comp_file1.out
echo "input_file2.out;`wc -l < input_file2.out | sed... (2 Replies)
Discussion started by: Hangman2
2 Replies
7. Shell Programming and Scripting
Hello!
I have one strange question - let's say I have a long, multiple-line string displayed on the terminal using echo, and I would like to make a carriage return to the beginning of this string, no to the beginning of the last line - is something like that possible? I would like to be able to... (1 Reply)
Discussion started by: xqwzts
1 Replies
8. Shell Programming and Scripting
Hi,
I would like to insert the line carriage retrun characters on each line. (2 Replies)
Discussion started by: koti_rama
2 Replies
9. Shell Programming and Scripting
I would like to remove carriage returns/line feeds in a text file, but in a specific cadence:
Read first line (Header Line 1), remove cr/lf at the end (replace it with a space ideally);
Read the next line (Line of Text 2), leave the cr/lf intact;
Read the next line, remove the cr/lf;
Read... (14 Replies)
Discussion started by: tomr2012
14 Replies
10. Shell Programming and Scripting
Hi All,
My requirement is to remove the carriage return in from the lines which i am reading if the length is lesser than 1330 and append the next line with it. Below is the realistic example of file structure.
Input file:
Blah blah blah blah Blah blah blah blah
Blah blah blah blah Blah... (16 Replies)
Discussion started by: mad man
16 Replies
COL(1) BSD General Commands Manual COL(1)
NAME
col -- filter reverse line feeds from input
SYNOPSIS
col [-bfhpx] [-l num]
DESCRIPTION
The col utility filters out reverse (and half reverse) line feeds so that the output is in the correct order with only forward and half for-
ward line feeds, and replaces white-space characters with tabs where possible. This can be useful in processing the output of nroff(1) and
tbl(1).
The col utility reads from the standard input and writes to the standard output.
The options are as follows:
-b Do not output any backspaces, printing only the last character written to each column position.
-f Forward half line feeds are permitted (``fine'' mode). Normally characters printed on a half line boundary are printed on the fol-
lowing line.
-h Do not output multiple spaces instead of tabs (default).
-l num Buffer at least num lines in memory. By default, 128 lines are buffered.
-p Force unknown control sequences to be passed through unchanged. Normally, col will filter out any control sequences from the input
other than those recognized and interpreted by itself, which are listed below.
-x Output multiple spaces instead of tabs.
The control sequences for carriage motion that col understands and their decimal values are listed in the following table:
ESC-7 reverse line feed (escape then 7)
ESC-8 half reverse line feed (escape then 8)
ESC-9 half forward line feed (escape then 9)
backspace moves back one column (8); ignored in the first column
carriage return (13)
newline forward line feed (10); also does carriage return
shift in shift to normal character set (15)
shift out shift to alternate character set (14)
space moves forward one column (32)
tab moves forward to next tab stop (9)
vertical tab reverse line feed (11)
All unrecognized control characters and escape sequences are discarded.
The col utility keeps track of the character set as characters are read and makes sure the character set is correct when they are output.
If the input attempts to back up to the last flushed line, col will display a warning message.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of col as described in environ(7).
EXIT STATUS
The col utility exits 0 on success, and >0 if an error occurs.
SEE ALSO
colcrt(1), expand(1), nroff(1), tbl(1)
STANDARDS
The col utility conforms to Version 2 of the Single UNIX Specification (``SUSv2'').
HISTORY
A col command appeared in Version 6 AT&T UNIX.
BSD
August 4, 2004 BSD