LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2009, 05:09 PM   #1
tostay2003
Member
 
Registered: Jun 2006
Posts: 126

Rep: Reputation: 15
special character


Hi,

I am trying to unload file from a database. Which contains few lines with the character below. Rest of the data was unloaded appropriately.

Code:

a) What does this below character means?
b) How can i remove it,
I already have

Code:
sed '/^$/d'
c) Will this effect the file by any means (If I am guessing properly, this is the eof notation)

Thanks for help
 
Old 01-05-2009, 05:13 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'd start by analyzing the record in the DB to find out what it is. Never assume...
Which DB are you using? If MySQL, see this page and use the ASCII() fn: http://dev.mysql.com/doc/refman/5.0/...functions.html
 
Old 01-05-2009, 05:48 PM   #3
tostay2003
Member
 
Registered: Jun 2006
Posts: 126

Original Poster
Rep: Reputation: 15
its universe database & those characters actually shouldn't be there in the unload file. But for some reason (one method) of unloading the file fetches these characters, the other method via application doesn't fetch this character
 
Old 01-05-2009, 07:01 PM   #4
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
The character you posted (0x0C) is a form-feed character (page break). Just a wild guess, but it may be that the method that produces these characters is attempting to format the output.
 
Old 01-06-2009, 02:05 AM   #5
tostay2003
Member
 
Registered: Jun 2006
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by raconteur View Post
The character you posted (0x0C) is a form-feed character (page break). Just a wild guess, but it may be that the method that produces these characters is attempting to format the output.
Yes, true, that method tries to format the output. Thanks for the info.

With command
Code:
od -c
I got the below result
Code:
0000000  \f  \n  \f  \n  \f  \n  \f  \n  \f  \n  \f  \n  \f  \n  \f  \n
0000020  \f  \n  \f  \n
0000024
I have tried two statements, but they didnt work.
a) The below code isn't removing it, or may be leaving out the newline characters

Code:
tr -d "\f"
b) The below sed statement is deleting the complete data

Code:
sed 's[ \t]*\f[ \t]*//g' | sed '/^$/d'

Last edited by tostay2003; 01-06-2009 at 10:55 AM.
 
Old 01-06-2009, 12:39 PM   #6
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
Try escaping the FF character with single quotes in the tr command, i.e.
Code:
cat infile | tr -d '\f' > outfile
 
  


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
Inserting a special character with the keyboard #2 Schreiberling Linux - General 1 06-11-2006 03:57 PM
Insert a special character with the keyboard? Schreiberling Linux - General 0 03-05-2006 09:09 AM
special character boolim Linux - General 1 08-29-2003 09:57 AM
i need help with a special character Hone101 Linux - Newbie 1 05-03-2003 07:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:01 AM.

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