10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi.
In need to delete line before and after pattern in file. I came to following commands.
Delete line before
sed -ni '/pattern/{x;d;};1h;1!{x;p;};${x;p;}' /etc/testfile
Delete line after
sed -i '/pattern/{N;s/\n.*//;}' /etc/testfile
Is it possible to merge it in single command? (3 Replies)
Discussion started by: urello
3 Replies
2. Shell Programming and Scripting
Greetings, I need some assistance here as I cannot get a sed line to work properly for me. I have the following list:
Camp.S01E04.720p.HDTV.X264-DIMENSION
Royal.Pains.S05E07.720p.HDTV.x264-IMMERSE
Whose.Line.is.it.Anyway.US.S09E05.720p.HDTV.x264-BAJSKORV
What I would like to accomplish is to... (3 Replies)
Discussion started by: choard
3 Replies
3. Shell Programming and Scripting
I have a string in which i need to match a pattern and then i need to delete that line which contains that matching string.
The string is ..
This is the given string
//abc/def/IC.5.4.3/test/...
i need to match //abc
I am writing like this
sed '/^/\/\abc/d' but it is not giving me... (4 Replies)
Discussion started by: codecatcher
4 Replies
4. Shell Programming and Scripting
working on interactive ftp script
saving log and want to remove the password from log
so "quote PASS foofoo" would become "quote PASS XXXXXXX"
replacing or removing the password is of no matter
have tried several sed commands but have only been successful with character matching not pattern
... (2 Replies)
Discussion started by: ppaprota
2 Replies
5. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
6. Shell Programming and Scripting
Hello sed gurus. I am using ksh on Sun and have a file created by concatenating several other files. All files contain header rows. I just need to keep the first occurrence and remove all other header rows.
header for file
1111
2222
3333
header for file
1111
2222
3333
header for file... (8 Replies)
Discussion started by: gary_w
8 Replies
7. UNIX for Dummies Questions & Answers
if i have a file test and have a number(123)456-7899
how do i delete this without deleting all digits in the file.
parentheses isn't necessary. (2 Replies)
Discussion started by: hobiwhenuknowme
2 Replies
8. HP-UX
I have one file which is having content as following...
0513468211,,,,20091208,084005,5,,2,3699310,
0206554475,,,,20090327,123634,85,,2,15615533
0206554475,,,,20090327,134431,554,,2,7246177
0103000300,,,,20090523,115501,89,,2,3869929
0736454328,,,,20091208,084005,75,,2,3699546... (7 Replies)
Discussion started by: ganesh.mandlik
7 Replies
9. Shell Programming and Scripting
I would like to remove characters from column 7 so that from an input file looking like this:
>HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD
I get something like that in an output file:
... (13 Replies)
Discussion started by: matlavmac
13 Replies
10. UNIX for Dummies Questions & Answers
Hey Everybody,
I am having much trouble figuring this out, as I am not really a programmer..:mad:
Datafile.txt
Column0 Column1 Column2
ABC DEF xxxGHI
I am running using WGET on a cronjob to grab a datafile, but I need to cut the first three characters from... (6 Replies)
Discussion started by: rickdini
6 Replies