¿How can i remove blank lines between all lines in a long text file?
Example
WrongFile.txt :
Line 1
Line 2
Line 3
CorrectFile.txt :
Line 1
Line 2
Line 3
Thanks in advance
:confused: (4 Replies)
I have joined 2 files. Join command worked fine.
but the result showing extra blank lines. I tried to remove blank spaces by using awk (-- -42 RS= ORS="\n\n" file.txt) and sed (sed '/^ *$/d' file.txt)commands but didn't remove any
Any suggestions plz:D
123 tab .......
......tab .......234... (3 Replies)
Hi All,
I was testing for blank lines and I want to use the cat command only
for groupline in `cat /home/test/group`
do
if
then
echo "blank found"
fi
done
I want to check if the current line read is a blank line.
I have tested with $groupline="\n" ,... (11 Replies)
I really hope someone can help me with this. I have several php files from a forum that I run, that now for some reason have blank lines after every line. Is there an easy way to make a script that does the following:
* If there are consecutive blank lines, delete all of them except one.
* If... (9 Replies)
Hi,
I'm not a expert in shell programming, so i've come here to take help from u gurus.
I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command.
I've a datatable csv of the below format -
--in file format
xx,xx,xx ,xx , , , , ,,xx,
xxxx,, ,, xxx,... (11 Replies)
The following grep command grep -v "^$" filename > newfilename does not populate the new file with any data. I see it search the entire input file but the output file never gets filled. Is this not the correct command for what Im looking to do? (2 Replies)
Hi,
I am facing a problem related to removing blank lines from a text document.
Input
Error 17-05-2011 11:01:15 VisualSVN Server 2.1 1001
The following information was included with the event:
line3
line4
Error 17-05-2011 11:00:25 VisualSVN Server 2.1 ... (13 Replies)
When I 'vi' my test file I see some blank lines. However once I do :set list to display hidden characters, I see the empty lines literally like this:
^I$
How do I remove them? I cannot find a regex to match them. (3 Replies)
Hello All,
I have a bash script and in it at some point I call an Expect Script that does some stuff and saves its
output in a ".txt" file.
Example "/path/to/my/file/Expect_Output.txt" file: notice the 2nd line is empty in the file...
Data for Host-1 (192.168.1.110)
Checking the... (2 Replies)
Hi,
Which option is used to remove blank lines in VI (AIX). ?
Regards,
Siva (6 Replies)
Discussion started by: ksgnathan
6 Replies
LEARN ABOUT BSD
cat
CAT(1) General Commands Manual CAT(1)NAME
cat - catenate and print
SYNOPSIS
cat [ -u ] [ -n ] [ -s ] [ -v ] file ...
DESCRIPTION
Cat reads each file in sequence and displays it on the standard output. Thus
cat file
displays the file on the standard output, and
cat file1 file2 >file3
concatenates the first two files and places the result on the third.
If no input file is given, or if the argument `-' is encountered, cat reads from the standard input file. Output is buffered in the block
size recommended by stat(2) unless the standard output is a terminal, when it is line buffered. The -u option makes the output completely
unbuffered.
The -n option displays the output lines preceded by lines numbers, numbered sequentially from 1. Specifying the -b option with the -n
option omits the line numbers from blank lines.
The -s option crushes out multiple adjacent empty lines so that the output is displayed single spaced.
The -v option displays non-printing characters so that they are visible. Control characters print like ^X for control-x; the delete char-
acter (octal 0177) prints as ^?. Non-ascii characters (with the high bit set) are printed as M- (for meta) followed by the character of
the low 7 bits. A -e option may be given with the -v option, which displays a `$' character at the end of each line. Specifying the -t
option with the -v option displays tab characters as ^I.
SEE ALSO cp(1), ex(1), more(1), pr(1), tail(1)BUGS
Beware of `cat a b >a' and `cat a b >b', which destroy the input files before reading them.
4th Berkeley Distribution May 5, 1986 CAT(1)