Help in viewing the junk character

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Help in viewing the junk character
# 1  
Old 10-28-2014
Help in viewing the junk character

Hello All,

I have issues in unix file when I loaded that to database and do
Code:
select * from table where description  like '%'+char(13)+'%'

on it I am able to get records. I tried to view the file in unix it is all having blank character which I think is all non ascii which I am not able view. Can you please help me a way to identify the junk character

1. I used cat -v, I still see empty spaces
2 I used od -c, I still see empty spaces
3 I used vim -b , I still see empty spaces
4 I used sed as
Code:
sed -n 'l' prj48n.cls

below is my output
Code:
0438After Shave                   $

Thanks
Arun
Moderator's Comments:
Mod Comment Please use CODE tags for input and output samples as well as for code samples.

Last edited by Don Cragun; 10-28-2014 at 04:16 PM.. Reason: Add CODE tags.
# 2  
Old 10-28-2014
Well, you could try opening the file using vi
and then:

:set list

Quick vi tip: Show Hidden Characters

Also, not sure what database you're loading to, however, if it is Oracle, you could use DUMP to show the characters:

Code:
select DUMP(col_name) from table where description like ....

# 3  
Old 10-28-2014
Hello ,

I tried to do a
Code:
set list

in vi and
Code:
list

in vim both showing that as blank character. When I load the same file to my sybase database it is showing junk character as char(13). I mean when I do select on char(13) it is showing records

Thanks,
Arun
# 4  
Old 10-28-2014
Why don't you post the output of od -c or even od -tx1c of that file?
# 5  
Old 10-28-2014
Hello,

Please find the output below

(p009Smilie3:/pl/data>)
Code:
od -c p48n.cls

Code:
0000000   0   4   3   8   A   f   t   e   r       S   h   a   v   e
0000020
0000040          \n
0000043

(p009Smilie3:/pl/data>)
Code:
od -tx1c p48n.cls

Code:
0000000 30 34 33 38 41 66 74 65 72 20 53 68 61 76 65 20
          0   4   3   8   A   f   t   e   r       S   h   a   v   e
0000020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

0000040 20 20 0a
                 \n
0000043

Thanks,
Arun
Moderator's Comments:
Mod Comment CODE tags are needed for sample input and output as well as for code samples.

Last edited by Don Cragun; 11-05-2014 at 02:25 PM.. Reason: Add CODE tags.
# 6  
Old 10-28-2014
Please use code tags around data/output as well!

OK, no junk chars, just a lot spaces. That's an all ascii *nix file.
# 7  
Old 10-28-2014
Thanks ...Smilie But I am not sure how this space is converted to char(13) -- ctrlM character in database when I load it

Thanks
Arun
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Junk character appearing after downloading the file from windows server

Hello, Im downloading the file from windows server through FTP, the downloaded file is containing some junk character at very start of the file as below and causing my whole script is to fail, how to download without junk or how to remove these before processing it? ▒▒"nmdbfnmdsfsdf" ... (19 Replies)
Discussion started by: Riverstone
19 Replies

2. Shell Programming and Scripting

How to see junk character in file in.?

Hi I want to know how to see junk character in a file. i am not able to see junk character using vi or cat command. below is the junk char . which i see in host file 10.178.14.67▒▒▒ ac01sp02-vip actually it should be like this 10.178.14.67 ac01sp02-vip i am using secure CRT... (11 Replies)
Discussion started by: scriptor
11 Replies

3. Shell Programming and Scripting

removing of junk character

Dear ALL, How to remove junk charecter ^M from unix file i am using sun solaris unix. I already tried few commands :%s/^M//g :%s/r//g but it didnt helped me. Any help appriciated. Thanks Ripudaman Please view this code tag video for how to use code tags when posting code... (5 Replies)
Discussion started by: ripudaman.singh
5 Replies

4. Shell Programming and Scripting

Check Junk character in sql file

Hello, I have two .sql files which I transferred from Windows to Unix (Linux Enterprise Linux Server release 5.3).I want to ensure that these two files have no junk characters in them.How do I do it in the simplest possible way? Many thanks DJ (1 Reply)
Discussion started by: Digjoy83
1 Replies

5. Shell Programming and Scripting

Junk Character appended at the end of a line

Hi All I have a rather unusual problem, which i have not faced till now. I have a script which exports some paths to a text file. The script runs fine but when i check the output file i can see some junk characters ^M appended at end of lines and random places. I am not able to figure... (4 Replies)
Discussion started by: raghu_shekar
4 Replies

6. Shell Programming and Scripting

Remove all JUNK character from file.

Hi Team, I have a file having size greater than 1 GB. What i want to do is to check if it contains any JUNK character (ie any special charater thats not on the key board stroke). This file has 532 column & seperated with ^~^. I have found some solution from the file, but it is for a... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies

7. Shell Programming and Scripting

Junk Character in file

Hi set filename "./GopiRun.sh" if } err] { writeLog "error in exec " writeLog $a } else { writeLog $a } The above code will execute a file GopiRun.sh,and will log the output of the exec to a file. The problem is the file has lot of junk character in it,how to avoid it. The... (2 Replies)
Discussion started by: nathgopi214
2 Replies

8. UNIX for Dummies Questions & Answers

How to remove junk (^Ò) character while FTPing

Hi All, I have been trying to FTP some data files from Windows directory to a UNIX server. The txt file in the windows contails the following data: "111~XYZ~1~Contact person’s phone number~COMMENTS~~~~" but the same line is appearing as "111~XYZ~1~Contact person^Òs phone number~COMMENTS~~~~"... (8 Replies)
Discussion started by: vkumbhakarna
8 Replies

9. UNIX for Advanced & Expert Users

Get rid of junk character in a file

I have a file with one of the following lines, when opened with vi 33560010686GPT£120600GBPGBP10082007DS In the above line, I want to get rid of the junk character before the £ (pound sysmbol). When I tried copying £ from windows and copy in unix vi, it prints as £ and I tried pattern replace... (2 Replies)
Discussion started by: nskworld
2 Replies
Login or Register to Ask a Question