Hi I have ubuntu server 12.04 running a pureftpd server. Whenever I donwload files from the sevrer it adds a extra line between every line. Like this...
Line one
(Blank line)
Line two
(Blank line)
Line three
(Blank line) = blank line
Its really irritating in html documents but when doing this with pictures, it breaks them and they cannot be read correctly.
Any ideas?
Thanks
Hi,
I'm trying to read a line and the next line in a shell script by executing the following code:
Code:
for i in `seq 1 $numLines`; do
line=$(sed -n '{$i}p' outputFile)
echo $line
done
$numLines contanis the outputFile's number of lines.
It doesn't work and I cannot use a while loop because I need to reed $(i+1) line after $i line.
I have a log-file where at the end of a series of lines you can see if this block is relevant
now I'm looking for a command like sed to delete de blocks ending with "Content-Length: 0" and beginning with the last "--" before this line.
I tried sed -n "/--/,/Content-Length: 0/d" but this takes the first "--" and the first "Content-Length: 0" and deletes it.
ex :
line 1 "--"
line 2
line 3 "
Add a line in a specific position with Linux
If you need to add a line to a file in Linux, and you need to add that line in a specific position of the file there is an easy solution, even if you need to do it to hundreds of thousands of files.
Consider this file:
line 1
line 2
line 4
As you can see we missed line 3, so to add it just execute this command:
sed '3iline 3'
Parts of the comm
I have a log-file where at the end of a series of lines you can see if this block is relevant
now I'm looking for a command like sed to delete de blocks ending with "Content-Length: 0" and beginning with the last "--" before this line.
I tried sed -n "/--/,/Content-Length: 0/d" but this takes the first "--" and the first "Content-Length: 0" and deletes it.
ex :
line 1 "--"
line 2
line 3 "
i have 3 files as below:
Code:
[test1][test2][test3]
i want to print 1st,2nd,5th and 10th filed of 1st to 5th lines from each files into a line of an output file, so the result would be:
[output]:
Code:
{line1}(field 1 of line 1 from file 1)(field 2 of line 1 from file 1)(field 5 of line 1 from file 1)(field 10 of line 1 from file 1)...(field 10 of line 5 from file 1)
{line2}(field 1
I have a large file which contains tables of different tab separated data. The different tables are separated by a blank line.
I have the line number of the start of a particular table and I need to retrieve the whole table.
How can I use grep (or something similar) to get the line number of the next blank line after a specific line number?
Hi,
I have a file as below
This is the line one
This is the line two
<\XMLTAG>
This is the line three
This is the line four
<\XMLTAG>
Output of the SED command need to be as below.
This is the line one
This is the line two
<\XMLTAG>
Please do the need to needful to get the desired output.
hi experts
i like to know how to print more line using getline command using awk. with below command i can only see one line (line no:1)
however i do have more line as shown below line no:2,line no:3,line no:4 and so forth. how do i get those to show up using the below command.