LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-03-2010, 12:41 AM   #1
dhirendrs
Member
 
Registered: Nov 2009
Posts: 45

Rep: Reputation: 15
In my database dump txt it is showing some special character as below


Hi all,

we have Centos linux and database postgresql and taking dump in .data files.

need to find all speical character in my database dump .data files it is open in txt paid and store in one txt file.

e.g of special character are as below.

2157013010798Â | 300505287
846127017237Â | 600357416
3607341063397Â | 300586860
885259255568Â | 300483594002
 884498138212 | 300598749001
091202284800Â | 300489771001
 888507485083 | 300598750001
8727900746143Â | 600350856
9.55506E+12 | 00000000010802917402
\r54534467 | 00000000030029004903
\\154534467 |00000000030029004903

regards
Dhiren shah
 
Old 11-03-2010, 08:28 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
Originally Posted by dhirendrs View Post
need to find all speical character in my database dump .data files
It isn't clear what you mean by "special" characters. For example, you could find all lines with control characters or high bit set using:
Code:
perl -ne 'if (!m/^[ -~]*$/){print $.,":",$_}' test.txt
That will print the line number and content of any line where there is no match on the regular expression (similar to 'grep -v', except that grep doesn't handle characters with the high bit set in quite the same way).

You could extend this to include all non-numeric characters, eg:
Code:
perl -ne 'if (!m/^[ |0-9.E+-]*$/){print $.,":",$_}' test.txt

Last edited by neonsignal; 11-03-2010 at 08:32 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
block special and character special files s_shenbaga Linux - Newbie 4 06-23-2015 02:16 AM
Migrate a MySQL database without special character hell brianmcgee Linux - Software 1 02-27-2009 09:35 AM
special character tostay2003 Programming 5 01-06-2009 12:39 PM
Webpage showing special character, inverted exclaimation mark jc_neo Linux - Newbie 0 10-15-2004 01:27 AM
i need help with a special character Hone101 Linux - Newbie 1 05-03-2003 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration