Sponsored Content
Top Forums Shell Programming and Scripting sed problem - last line of file deleted Post 302251994 by ghostdog74 on Tuesday 28th of October 2008 01:50:00 PM
Old 10-28-2008
Code:
more +2  file > newfile
mv newfile file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sed new line problem

Hi all, I've searched the web and this forum for this but not had any luck. I'm trying to use sed so when it finds a space it will insert a new line. What i have is a file containing .e.g 1 2 4 7 9 and want it to look like 1 2 4 7 9 I've tried: more test2 | sed 's/ /\\n/g'... (1 Reply)
Discussion started by: Cordially
1 Replies

2. Shell Programming and Scripting

SED - editing file names (End of line problem?)

For lists in sed, to say what to replace, is this correct: I am hoping that this would recognise that either a "." is present, or that the substitution happens at the end of the line. For files with extensions , my script works perfectly. My problem is, files without extentions, i.e. . ... (1 Reply)
Discussion started by: busillis
1 Replies

3. UNIX for Dummies Questions & Answers

logging deleted records by sed

Hi, I want to use the sed command to delete some lines in a file and I was wondering whether there is a possibility of knowing which lines are deleted, or at least which line numbers. Thanks (4 Replies)
Discussion started by: vanagreg
4 Replies

4. Shell Programming and Scripting

Sed line concatenation problem

I have a somewhat bizarre problem when trying to concatenate lines in a file. Using cat file.txt | sed -e :a -e '/$/N;s/\n/ /;ta' the output in file.txt should go from 1 2 3to 1 2 3 instead I only get the last line or 3. I find that if I open the file in gedit and hit delete in front of every... (7 Replies)
Discussion started by: pluto7777
7 Replies

5. Shell Programming and Scripting

Another parsing line awk or sed problem

Hi, After looking on different forums, I'm still in trouble to parse a parameters line received in KSH. $* is equal to "/AAA:111 /BBB:222 /CCC:333 /DDD:444" I would like to parse it and be able to access anyone from his name in my KSH after. like echo myArray => display 111 ... (1 Reply)
Discussion started by: RickTrader
1 Replies

6. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

7. Shell Programming and Scripting

Replace pattern with deleted line?

If I have this: perl -pne 's/img_onload.{8}//g' How would I do to instead of replacing img_onload.{8} with "nothing", get "nothing" to be a deleted line? Kind of the opposite to \n. (2 Replies)
Discussion started by: KidCactus
2 Replies

8. Shell Programming and Scripting

Last line gets deleted

I was using the following option to clean up the ^M characters in a file that was FTPed from Windows: - dos2unix - sed 's/^M//g' The ^M characters are removed but the last line is also getting removed. Any idea why this is happening. Satish (2 Replies)
Discussion started by: vskr72
2 Replies

9. Shell Programming and Scripting

sed delete but save deleted output into other file

Hi guys, I am currently using this to save first 50 lines into top50.txt and delete them from list.txt ... it's 2 commands: head -n 50 list.txt > top50.txt && sed -i "1,50 d" list.txt I want to change that so it's 1 command - whereby sed removes the first 50 lines as above but that which is... (3 Replies)
Discussion started by: holyearth
3 Replies

10. Shell Programming and Scripting

sed command to replace a line in a file using line number from the output of a pipe.

Sed command to replace a line in a file using line number from the output of a pipe. Is it possible to replace a whole line piped from someother command into a file at paritcular line... here is some basic execution flow.. the line number is 412 lineNo=412 Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
aha(1)								 Ansi HTML Adapter							    aha(1)

NAME
aha - Ansi HTML Adapter SYNOPSIS
aha [options] [-f datei] DESCRIPTION
aha takes SGR-colored Input and prints W3C conform HTML-Code. aha reads the Input from a file or stdin and writes HTML-Code to stdout. OPTIONS
--help , -h , -? A help like this --black , -b Black Background and white "standard color" --pink , -p Pink Background --iso X , -i X Uses ISO 8859-X instead of utf-8. X must be 1..16 --title X , -t X Gives the html output the title --line-fix , -l Uses a fix for inputs using control sequences to change the cursor position like htop. It's a hot fix, it may not work with any pro- gram like htop. (See EXAMPLE) EXAMPLE
aha --help | aha --black --title "the awesome aha help"> aha-help.htm Creates an HTML file with the help of aha with black background colordiff oldfile.c newfile.c | aha > colordiff.htm Creates an HTML file with a colorful diff-output of two files "oldfile.c" and "newfile.c" with white background ls --color=always | aha --pink > ls.htm Creates an HTML file with a colorful ls-output with pink background. echo a | htop | aha --black --line-fix > htop.htm Creates an HTML file with the output of htop. You have to use --line-fix due the other new-line-commands htop uses. AUTHOR
Copyleft Alexander Matthes aka Ziz 2011 zizsdl@googlemail.com SEE ALSO
http://ziz.delphigl.com/tool_aha.php August 31, 2011 aha(1)
All times are GMT -4. The time now is 01:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy