04-29-2008
but the most correct way is not using grep here. Because it potentially can match value from other fields.
Here is an awk solution:
awk '$3!=0012777201 && $3!=0012777202; BEGIN {FS="|"}' 1.txt
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
can I do something like this to add a condition of checking if the 4th field is number or space or blank also:
awk -F, '$4 /^*||*/' MYFILE >> OTHERFILE
I also want the other part i.e. I need to exclude all lines whose 4th field is space or blank or number:
MYFILE
a,b,c,d,e
a,b,c,2,r... (2 Replies)
Discussion started by: praveenK_Dudala
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Can some one help me how to exclude multiple directories using find command..
I have the directory structure below.
/a/a1/b1
/a/c1/c2
/a/d1/d2/d3
I want to exlcude a1,c2and d3 from the above using find,can some one suggest pls..
thanks in advance...
Use code tags... (1 Reply)
Discussion started by: jagadish_gaddam
1 Replies
3. Shell Programming and Scripting
Hi All,
I have a *.csv files in a die /pro/lif/dow, (pipe delimiter file), these files are having 8 columns and 6 column(CDR_LOGIC) records are populated as below, I need to incorporate the below logic in all the *.csv files.
11||:ColumnA||:ColumnB
123||:ColumnA
IIF(:ColumnA = :ColumnC then... (6 Replies)
Discussion started by: shruthidwh
6 Replies
4. Shell Programming and Scripting
Hi ,
I have the below source
source data
1|2|3|:123:abc|4
1|2|a| | 5
1|2|3|4|:a:s:D.....:n|t
Target data should be
1|2|3|:123:abc|4
1|2|3|:123:abc|4
1|2|a| | 5
1|2|3|4|:a:s:D.....:n|t
1|2|3|4|:a:s:D.....:n|t
1|2|3|4|:a:s:D.....:n|t
1|2|3|4|:a:s:D.....:n|t (3 Replies)
Discussion started by: mora
3 Replies
5. Ubuntu
I am familiar with using tar and exclude/include files:
tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion
but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies
6. Shell Programming and Scripting
Hi All,
I am trying to split a record into multiple records based on a value.
Input.txt
"A",1,0,10
"B",2,0,10,15,20
"C",3,11,14,16,19,21,23
"D",1,0,5
My desired output is:
"A",1,0,10
"B",2,0,10
"B",2,15,20
"C",3,11,14
"C",3,16,19
"C",3,21,23 (4 Replies)
Discussion started by: kmsekhar
4 Replies
7. Shell Programming and Scripting
Hi,
I have 3 tab delimited text files which look like this.
File1:
PROTEINID DESCRIPTION PEPTIDES FRAMES
GB://115298678 _gi_115298678_ref_NP_000055.2_ complement C3 precursor 45 55
GB://4502027 _gi_4502027_ref_NP_000468.1_ serum albumin preproprotein 34 73
Entrez://strain 11128 /... (3 Replies)
Discussion started by: Vavad
3 Replies
8. Shell Programming and Scripting
I need to make one record to multiple records based on occurence column in the record and change the date.For example below first record has 5 ,so need to create 5 records from one and change the date to 5 months.Occurence can be any number.
I am unable to come with a script.Can some one help
... (5 Replies)
Discussion started by: traininfa
5 Replies
9. Shell Programming and Scripting
Hi
I have a txt file and I would like to use egrep without using -v option to exclude the lines which matches with multiple Strings.
Let's say I have some text in the txt file. The command should not fetch lines if they have strings something like
CAT MAT DAT
The command should fetch me... (4 Replies)
Discussion started by: Sathwik
4 Replies
10. Shell Programming and Scripting
Hi,
I'm working on a shell script that reports service status on a database server.
There are some services that are in disabled status that the script should ignore and only check the services that are in Enabled status.
I output the service configuration to a file and use that information to... (5 Replies)
Discussion started by: senthil3d
5 Replies