Sponsored Content
Top Forums Shell Programming and Scripting Remove all JUNK character from file. Post 302282188 by quirkasaurus on Friday 30th of January 2009 09:55:06 AM
Old 01-30-2009
saves only ASCII

I typically use this:

Code:
sed -e 's/[^ -~]//g' file_in > file_out

This removes all junk characters. not all lines with junk --- just all junk characters.

To tell if a file has junk . .. .

Code:
grep -c '[^ -~]' file_in

 

10 More Discussions You Might Find Interesting

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

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

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

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

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

6. Shell Programming and Scripting

Remove all junk characters from a text file

I am using flatfile, in that flat file we are getting the junk chars 1)I21001f<82>^Me<85>!h49 Service Charge 2) I21001f‚ e...!h49 Service Charge please tell me how to remove all junk chars in unix scripts. (1 Reply)
Discussion started by: Talari
1 Replies

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

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

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

10. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies
ACTIVE(5)                                                       File Formats Manual                                                      ACTIVE(5)

NAME
active, active.times - list of active Usenet newsgroups DESCRIPTION
The file /var/lib/news/active lists the newsgroups that the local site receives. Each newsgroup should be listed only once. Each line specifies one group; their order in the file does not matter. Within each newsgroup, articles are assigned unique names, which are mono- tonically increasing numbers. If an article is posted to newsgroups not mentioned in this file, those newsgroups are ignored. If no valid newsgroups are specified, the article is filed into the newsgroup ``junk'' and only propagated to sites that receive the ``junk'' newsgroup. Each line consists of four fields specified by a space: name himark lomark flags The first field is the name of the newsgroup. The second field is the highest article number that has been used in that newsgroup. The third field is the lowest article number in the group; this number is not guaranteed to be accurate, and should only be taken to be a hint. Note that because of article cancellations, there may be gaps in the numbering sequence. If the lowest article number is greater then the highest article number, then there are no articles in the newsgroup. In order to make it possible to update an entry in-place without rewriting the entire file, the second and third fields are padded out with leading zeros to make them a fixed width. The fourth field can contain one of the following flags: y Local postings are allowed n No local postings are allowed, only remote ones m The group is moderated and all postings must be approved j Articles in this group are not kept, but only passed on x Articles cannot be posted to this newsgroup =foo.bar Articles are locally filed into the ``foo.bar'' group If a newsgroup has the ``j'' flag, then no articles will be filed into that newsgroup and local postings to that group should not be gener- ated. If an article for such a newsgroup is received from a remote site, it will be filed into the ``junk'' newsgroup if it is not cross- posted. This is different from not having a newsgroup listed in the file because sites can subscribe to ``j'' newsgroups and the article will be propagated to them. If the fourth field of a newsgroup starts with an equal sign, then the newsgroup is an alias. Articles can be posted to the group, but will be treated as if they were posted to the group named after the equal sign. The second and third fields are ignored. Note that the Newsgroup header is not modified (Alias groups are typically used during a transition, and are typically created with ctlinnd(8)). An alias newsgroup should not point to another alias. The file /var/lib/news/active.times provides a chronological record of when newsgroups are created. This file is normally updated by innd(8) whenever a ctlinnd ``newgroup'' command is done. Each line consist of three fields: name time creator The first field is the name of the newsgroup. The second field is the time it was created, expressed as the number of seconds since the epoch -- i.e., a time_t; see gettimeofday(2). The third field is the electronic mail address of the person who created the group. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.13, dated 1996/10/29. SEE ALSO
ctlinnd(8), innd(8). ACTIVE(5)
All times are GMT -4. The time now is 06:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy