How to grep all lines from a file NOT having a certain character

Hi,

I have for instance following INPUT file from which I want to grep ALL lines NOT containing the literal '{' into an OUTPUT file:

 
...
RUNJOB=1,AxBxALLxGEx     
RUNJOB=0,AxBxDELxGExPRAEMxABLxZGS     
RUNJOB=0,AxBxDELxGExPRAEMxHARM  
RUNJOB=0,{UNIX: echo '�ASG�;%ASG_START}
RUNJOB=1,{UNIX: %!PATH_SCRIPT!%merge_files.sh %!}
...

What is the command?

Thanks

grep -v '{' INPUT > OUTPUT

thank you, it works :slight_smile:

---------- Post updated at 05:06 AM ---------- Previous update was at 05:00 AM ----------

sorry, but there is a problem: I have no more carriage return after each line.
I don't know why, but my INPUT file had carriage return after each line and that's the way it should be in my output file. Now with using the grep command, my OUTPUT file has the result all in one line

can you help me inserting carraiage return after each result?

try..

awk '!/{/ {print $0}' file

I think the problem is that I use also the "cut-command"

 
grep '{' INPUT_FILE | cut -d ',' -f1-2 >>OUTPUT_FILE

without "cut" it works, but I need to cut the files.

awk did not work or I used it the wrong way

why do you need to cut it?

---------- Post updated at 06:49 PM ---------- Previous update was at 06:46 PM ----------

you still get the entire line. so cut is of no use

actually my Input file is much longer and has more than one ','
I just shortened my postings for better reading

does your file came from windows? convert it

dos2unix

thank you I solved it by inserting a dummy

 
echo "" >>OUTPUT_FILE

now it works :slight_smile: