Big (at least to me) sed proble


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Big (at least to me) sed proble
# 1  
Old 02-04-2007
Java Big (at least to me) sed proble

hi all,
i am again surrounded by a big problem,,,

i have 2 files

file1.txt file2.txt
aaaa xxxx xxxxx
xxxxxxxxxxxxxxx
zzzz zzzz zzz bbb

aaaa xx xxxx xxxx
xxx zzzz zzzz zzz
yyy yy xx xxxxxx

i need to have selection in the script as
#!/bin/sh
for file in file*txt
do
sed -n '/aaa/,/bbb/p' $file >outputfile

done

but i get in outfile is mix of required pattern space {ie aaa--bbb} and unwanted space from {aaaa(II)--EOF}
how to remove this second unwanted pattern spaces from getting printed ... Smilie
# 2  
Old 02-04-2007
sed -n '/aaaa/,/bbb/p;/bbb/q'
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Double quotes and variable proble in echo

HI Guys, I want to echo below line in my file :- lpd | grep AL | nawk '{print "1dLA - " $0} How can i echo same Output (4 Replies)
Discussion started by: pareshkp
4 Replies

2. UNIX for Advanced & Expert Users

sed working slow on big files

HI Experts , I'm using the following code to remove spaces appearing at the end of the file. sed "s/*$//g" <filename> > <new_filename> mv <new_filename> <filename> this is working fine for volumes upto 20-25 GB. for the bigger files it is taking more time that it is required... (5 Replies)
Discussion started by: sumoka
5 Replies

3. Shell Programming and Scripting

sed of big html files

hi friends, i have to cut a large html file between tag " <!-- DEFACEMENTS ROWS -->" "<!-- DISCLAIMER FOOTER -->" and store cut data in other file please help me!!!! (2 Replies)
Discussion started by: praneshbmishra
2 Replies

4. Shell Programming and Scripting

Big data file - sed/grep/awk?

Morning guys. Another day another question. :rolleyes: I am knocking up a script to pull some data from a file. The problem is the file is very big (up to 1 gig in size), so this solution: for results in `grep "^\ ... works, but takes ages (we're talking minutes) to run. The data is held... (8 Replies)
Discussion started by: dlam
8 Replies

5. Linux

proble in running .properties file

# Timer for thread to sleep thread.sleep =15000 # To run the thread as daemon process thread.run = true # Copy command thread.cmd = C:\Program Files\Java\jdk1.5.0\bin\java CopyFile This is .properties file. CopyFile is name of program. is that ok. if i use cp command inplace of... (0 Replies)
Discussion started by: sari
0 Replies

6. Shell Programming and Scripting

Awk array proble!!!Please help

I need help with a problem that I have not been able to figure out. I have a file that is about 650K lines. Records are seperated by blank lines, fields seperated by new lines. I was trying to make a report that would add up 2 fields and associate them with a CP. example output would be... (0 Replies)
Discussion started by: timj123
0 Replies

7. Shell Programming and Scripting

proble in ftp script

i had written one script that make connection with remote host get some file and close the connection .. it works fine .. but when i put this scrip in between control structure commands like "if , case " then it give me error like" syntax error at line 26 : `<<' unmatched" please tell me... (6 Replies)
Discussion started by: ravindra shukla
6 Replies

8. Shell Programming and Scripting

filter parts of a big file using awk or sed script

I need an assistance in file generation using awk, sed or anything... I have a big file that i need to filter desired parts only. The objective is to select (and print) the report # having the string "apple" on 2 consecutive lines in every report. Please note that the "apple" line has a HEX... (1 Reply)
Discussion started by: apalex
1 Replies
Login or Register to Ask a Question