Question related to grep


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Question related to grep
# 1  
Old 12-10-2014
Question related to grep

We have huge file with control A as delimiter. Somehow one record is corrupted. This time i figured it out using ETL graph. If future , how to print only bad record.

Example Correct record:
Code:
806136231281^A2457001000^A20141210^A510^A20141209^A07^A77^A20141210^A509^AKIXH^A0000252224^A20141209201028915^A20141209200900^A4^A^A^A^AN^AN^A20141210^A0509^A20141209200900^A20141210^A0509^A20141209200900^A^A^A^A^A^A26133^A

Example Bad record:
Code:
772142674040^A2457001000^A20141209^A2125^A20141208^A10^A^A20141209^A2115^ACDGHU^A0000455061^A20141209202534877^A20141209201500^AH^A^A^A^AN^AN^A20141M-pM-CM-LM-^G2115^A20141209201500^A20141209^A2115^A20141209201500^A^A^A^A^AAUTOPOST^A^A

# 2  
Old 12-10-2014
Hi, see if this works:
Code:
awk '/[^[:alnum:]\n]/' RS='\001' file


Last edited by Scrutinizer; 12-10-2014 at 02:15 PM..
# 3  
Old 12-10-2014
Quote:
Originally Posted by Scrutinizer
Hi, see if this works:
Code:
awk '/[^[:alnum:]\n]/' RS='\001' file

Thank you for your reply. No its not working. I was able to get it using following command.

grep -P "[\x80-\xFF]" <file_name>
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Question related to 'ps'

If I run a script called 'abc.sh' and then execute the following : ps -ef | grep 'abc.sh' I always get two rows of output, one for the executing script, and the other for the grep command that I have triggered after the pipe. Questions: Why does the second row turn up in the results. My... (10 Replies)
Discussion started by: jawsnnn
10 Replies

2. Shell Programming and Scripting

Perl related question

hi, iam perl begginer,i have written the program #!/usr/bin/perl #use warnings; use strict; print "Enter the name:","\n"; my $name=<STDIN>; my %hash=(siva => "9902774481", dev => "9916391244", venky => "9440506760", manohar => "9440232695" ); print "$name no is:... (5 Replies)
Discussion started by: siva.hardwork
5 Replies

3. Shell Programming and Scripting

awk related question

awk "/^<Mar 31, 2012 : /,0" /app/blah.log can someone please help me figure out why the above command isn't pulling anything out from the log? basically, i want it to pull out all records, from the very first line that starts with the date "Mar 31, 2012" and that also has a time immediately... (4 Replies)
Discussion started by: SkySmart
4 Replies

4. UNIX for Dummies Questions & Answers

query related to grep

Hi All, The result for 'grep "cert_codes" /develop/sales/appl.srce/*.4gl' command will be saved at aa.txt grep "cert_codes" /develop/sales/appl.srce/*.4gl >aa.txt But I am not sure, whether, all result stored in .txt file in case of multi-line result. Please revert back if... (2 Replies)
Discussion started by: pbankar
2 Replies

5. Solaris

RBAC related question.....

I am referring Bill Calkins(SCSA exam prep) for RBAC..actually i wanted to make a normal user to get the privilege to run a command through authorization, not through profile files... This is the exact steps given by Bill calkins.. 1.roleadd -m -d /export/home/adminusr -c... (11 Replies)
Discussion started by: saagar
11 Replies

6. Shell Programming and Scripting

Grep related thing

Is there any way i can use grep to do this I have file which is continuously growing,I want grep to star search from say line number 1210 is that possible. (5 Replies)
Discussion started by: aliahsan81
5 Replies

7. UNIX for Advanced & Expert Users

One Question related to alias

Hello, I have created following alias in csh lab 'rlogin -l user23 complab23' but problem is complab23 does not allow automatic login by checking .rhosts file. So after typing lab on command line I have to type complicate password and if wrong password is typed thrice then account gets... (4 Replies)
Discussion started by: neerajrathi2
4 Replies

8. Programming

signals related question

Hi all, Just a little question relative to signals. I know that if an application is in the sleep state, When a signal is catched, it will be processed by the handler. But what happens if it's processing something? Does the processing stops?? The following code should illustrate this case ... (2 Replies)
Discussion started by: ninjanesto
2 Replies

9. Shell Programming and Scripting

a math related question

hello: First I know the rules on Homework related questions, I wrote my script, but I cannot seem to figure out how to do one math problem. How do I take a zip code and seperate the idvidual digits? I used the modulus expression and divided the number by 10 ^ n but that only worked... (9 Replies)
Discussion started by: jahjah
9 Replies

10. UNIX for Dummies Questions & Answers

A Question related to the net

well, I was suggested to remove the contents of the cache as i get out of the browser netscape from the .netscape folder. is that really necessary? if so what are the rest to be done? can anybody please tell me?:rolleyes: (8 Replies)
Discussion started by: sskb
8 Replies
Login or Register to Ask a Question