dos2unix -- and FTP ASCII mode -- generally only handles line ending convention translations. The file is in a Windows character set; you need to convert it to whatever you are currently using. We can only guess what you would like it to be, and what the original character set is, but have a look at recode and iconv. If you don't have them installed locally, they are available on the Internet. Or if you have a strong stomach, use Windows and "save as" into a sane file format.
For a quick and dirty solution, find out the octal character code of the problematic character (od gives you a basic dumping facility, but it's a bit hard to read -- try piping in just a single line, rather than od:ing the whole file; or if you have xxd or hexdump, you can get more readable output, albeit in hex, not octal) and tr allows you to substitute it with something else.
I'm only using \222 as an example here; the character you want to find is most likely something else.
Don't assume there aren't other "funny" character codes in the file. As a matter of fact, there probably are.
Last edited by era; 03-25-2008 at 07:37 AM..
Reason: Clarify that 222 is just an example
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)
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)
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)
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)
I wanted to remove junk char in my csv. :mad:
Input file format:
"17","9986782190","0","D","2"
"17","9900918331","0","D","2"
"13","9986782194","0","A","2"
Output file format
9986782190
9900918331
9986782194
And one more thing all the time "13"," this will be different Ex: . (2 Replies)
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)
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)
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)
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)
Hi All,
I have a issue that we are getting Junk characters from source and i am not able to load that records to Database.
Line breakers
Junk Characters (Â and different every time)
Japanese Characters
Every time I am using grep command and awk -F "\007" to find them and delete that... (1 Reply)
Discussion started by: spradeep86
1 Replies
LEARN ABOUT OSF1
remove
remove(3) Library Functions Manual remove(3)NAME
remove - Removes a file
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <stdio.h>
int remove( const char *path );
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
remove(): POSIX.1, XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to the file to be removed.
DESCRIPTION
The remove() function causes a file named by the pathname pointed to by path to be no longer accessible by that name. A subsequent attempt
to open that file using that name will fail unless it is created anew.
If the path parameter names a directory, remove(path) is equivalent to calling the rmdir() function on that directory. If path does not
name a directory, remove(path) is equivalent to unlink(path).
NOTES
If the file operated upon by the remove() function has multiple hard links, the link count in the file is decremented and only the speci-
fied file name is removed.
RETURN VALUES
Upon successful completion, the remove() function returns 0 (zero). Otherwise, a nonzero value is returned. Refer to the unlink() function
and the rmdir() function for information on return values.
ERRORS
Refer to the unlink() function and the rmdir() function for information on error conditions.
RELATED INFORMATION
Functions: link(2), rename(2), rmdir(2), unlink(2)
Standards: standards(5) delim off
remove(3)