Junk character appearing after downloading the file from windows server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Junk character appearing after downloading the file from windows server
# 15  
Old 09-08-2014
Hi Don,

Below is the output
Code:
od -bc filename |head -3
0000000  456 567 043 000 123 000 456 000 145 000 157 000 184 000 184 000
           ▒   ▒   "  \0   R  \0   P  \0   e  \0   n  \0  Qt  \0   l  \0

I have tried both the command suggested by you.

1. iconv -f UTF-16 -t UTF-8 filename > utf8.txt .. got converted in a starnge format
Code:
head -1 utf8.txt
琀 挀漀搀攀 漀昀 ⠀ ⤀⸀ഀ਀∀一椀最栀琀开䨀

2. iconv -f UTF-16 -t ISO8859-1 filename > 8859.txt this is giving nothing rather than a empty file.

About sensitivity of data yes data is being altered fully pasting just the dummy samples.

Last edited by rbatte1; 09-08-2014 at 01:22 PM..
# 16  
Old 09-08-2014
Hi Riverstone,

It might be worth a look here, to see if you can identify the file type.

Regards

Dave
# 17  
Old 09-08-2014
I am seriously surprised by your od -bc output, as 456, 567, and 184 cannot be octal bytes, and 456 in the beginning is interpreted as a block char, whilst it's a "P" later on. 184 has two meanings as well. Puzzled.

And, it's different from previous samples again. How many files are we talking of?
# 18  
Old 09-08-2014
Quote:
Originally Posted by Riverstone
Hi Don,

Below is the output
Code:
od -bc filename |head -3
0000000  456 567 043 000 123 000 456 000 145 000 157 000 184 000 184 000
           ▒   ▒   "  \0   R  \0   P  \0   e  \0   n  \0  Qt  \0   l  \0

I have tried both the command suggested by you.

1. iconv -f UTF-16 -t UTF-8 filename > utf8.txt .. got converted in a starnge format
Code:
head -1 utf8.txt
琀 挀漀搀攀 漀昀 ⠀ ⤀⸀ഀ਀∀一椀最栀琀开䨀

2. iconv -f UTF-16 -t ISO8859-1 filename > 8859.txt this is giving nothing rather than a empty file.

About sensitivity of data yes data is being altered fully pasting just the dummy samples.
And yet you still refuse to tell us what locale you're using! What is the output from the command?:
Code:
locale

# 19  
Old 09-09-2014
HTML Code:
locale
LANG=en_US
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_MESSAGES="en_US"
LC_ALL=
File is surely UTF-16 only, we are talking about the single file.
# 20  
Old 09-09-2014
I have heard that on some versions of AIX, the en_US locale uses the IBM 850 code set rather than USASCII, ISO 8859-1, or UTF-8 that would commonly be used on other systems.

Use:
Code:
locale -a|grep en_US

to get a list of available US English locales. Hopefully, you will see something like en_US.ISO8859-1 or en_US.UTF-8. If en_US.ISO8859-1 is in the list, try:
Code:
LC_ALL=en_US.ISO8859-1 cat 8859.txt

or if en_US.UTF-8 is in the list, try:
Code:
LC_ALL=en_US.US.UTF-8 cat utf8.txt

where 8859.txt and utf8..txt are the files you created earlier using iconv. You could also try setting LC_ALL=C before cat'ing those two files.

If one of those works, look through your shell's initialization scripts and change whatever is setting LANG and the LC_* variables to en_US to instead set them to the one of the above that works for you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Help in viewing the junk character

Hello All, I have issues in unix file when I loaded that to database and do 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.... (11 Replies)
Discussion started by: arunkumar_mca
11 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. UNIX for Dummies Questions & Answers

PS1 (Prompt character) appearing in cat output

RedHat Linux 5.8/Korn Shell I have text file name /etc/oracle/config.loc. It has the following text #Device/file getting replaced by device +OCR ocrconfig_loc=+DATA ocrmirrorconfig_loc=+OCRBut , when I open this file using cat , the PS1 character (for prompt) appears as the last character... (8 Replies)
Discussion started by: omega3
8 Replies

4. 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

5. 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

6. UNIX for Dummies Questions & Answers

[Solved] Count amount of times of appearing of character before a word?

Hello Is there a way to calculate how many times a particular symbol appeared in a string before a particular word. Desktop/Myfiles/pet/dog/puppy So, I want to count number of occurence of"/" in this directory before the word dog lets say. Cheers, Bob (3 Replies)
Discussion started by: FUTURE_EINSTEIN
3 Replies

7. Windows & DOS: Issues & Discussions

Downloading a file from Website to a Windows Folder

Hi, Is it possible to download a file using Wget or some other command from a Windows machine? Say I want to download something from https server to C:\ABC\abc.xls Any ideas, Thanks. (4 Replies)
Discussion started by: dohko
4 Replies

8. 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

9. 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

10. 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