Sponsored Content
Full Discussion: Replacing Characters
Top Forums Shell Programming and Scripting Replacing Characters Post 302235310 by ahkverma on Thursday 11th of September 2008 04:55:37 PM
Old 09-11-2008
try this
cat filename |tr -s "." "\n"
Quote:
Originally Posted by karansachdeva
Hi All,

I have a file which is delimeted with the character '. i need to replace this character with the same character and also a new line.

Can anyone please help me with the tr command for this.

Many thanks

Karan
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

replacing few characters in a file

Hi All, I have huge xml file. The file contains some comment tags . I have requirement to replace comment tag with another comment tag. Say for example : file X has -- Part of the file <?xml version="1.0" encoding="ISO-2"?><translationResults jobDate="20070123 23:20:51"... (1 Reply)
Discussion started by: purnakarthik
1 Replies

2. Shell Programming and Scripting

replacing certain characters with new line?

i have a text file which domains something like this 123213213213/32434342 324324324/12312321321 12321321,435435435 12321312 / 12313213 / 12435435345 4353213 , 123213213213 21321321312-12334324 234324324 - 235645645645 456456456 - 45456456456 - 45645645654243 how can i replace '/' and... (4 Replies)
Discussion started by: Bashar
4 Replies

3. UNIX for Dummies Questions & Answers

replacing characters

Hi, I have a script for replacing bad characters in filenames for f in *; do mv $f `echo $f | tr '+' '_'` done; this replaces + for _ But I need to replace all bad characters ? / % + to _ Pls how can i do this in one script ? (3 Replies)
Discussion started by: palmer18
3 Replies

4. UNIX for Dummies Questions & Answers

replacing the characters in a file

hi i want to replace the characters between positions 2 to 30 in each line in a file how to do it suggestions welcome (2 Replies)
Discussion started by: trichyselva
2 Replies

5. Shell Programming and Scripting

replacing characters

hi all I have a file that has sone spaces in start then / at last. i want to get rid of this. how to do? eg. 11414/ 49878/ 27627/ I WANT THE FILE AS 11414 49878 27627 PLEASE HELP (3 Replies)
Discussion started by: infyanurag
3 Replies

6. Shell Programming and Scripting

Replacing Characters with |

Hi All, example data.log 526569346 66815531961 09 526569346 66815531961 09 526569346 66815531961 09 526569346 66815531961 09 526569346 66815531961 09 I want like this to 526569346|66815531961|09 526569346|66815531961|09... (4 Replies)
Discussion started by: ooilinlove
4 Replies

7. Shell Programming and Scripting

Replacing characters

Hi fellow experts, I have a question for you. Data looks like: 00877,05/13/2010,PBO,P,0000708331,518 00877,05/13/2010,PBO,P,0000708331,519 ... ... 00877,05/13/2010,PBO,P,0000708331,2103 00877,05/13/2010,PBO,P,0000708331,2104,etc,etc Basically I have to replace 518,519,2103,2104,... (4 Replies)
Discussion started by: Devski123
4 Replies

8. Shell Programming and Scripting

Replacing junk characters

Hi, I have a file with data as given below $cat file1 123|abc|345 345|def|567 The first record is good record. The second record has an invisible junk character like \032. I was replace all the occurences of that invisible character with #. I want to do this for a set of... (16 Replies)
Discussion started by: ashwin3086
16 Replies

9. Shell Programming and Scripting

Echo is replacing characters

Hi All, I'm using KSH and am writing a small script that counts the lines of various files in several folders under one root folder. Below is the script: #!/usr/bin/ksh common_path_in="/interface_in/rsc" file_out="/interface_in/rsc/record_count.csv" tot_rec_count=-1 act_rec_count=-1... (5 Replies)
Discussion started by: jagari
5 Replies

10. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies
CHARMAP(5)							 Linux User Manual							CHARMAP(5)

NAME
charmap - character symbols to define character encodings DESCRIPTION
A character set description (charmap) defines a character set of available characters and their encodings. All supported character sets should have the portable character set as a proper subset. Syntax The charmap file starts with a header, that may consist of the following keywords: <codeset> is followed by the name of the codeset. <mb_cur_max> is followed by the max number of bytes for a multibyte-character. Multibyte characters are currently not supported. The default value is 1. <mb_cur_min> is followed by the min number of bytes for a character. This value must be less or equal than mb_cur_max. If not specified, it defaults to mb_cur_max. <escape_char> is followed by a character that should be used as the escape-character for the rest of the file to mark characters that should be interpreted in a special way. It defaults to the backslash ( ). <comment_char> is followed by a character that will be used as the comment-character for the rest of the file. It defaults to the number sign ( # ). The charmap-definition itself starts with the keyword CHARMAP in column 1. The following lines may have one of the two following forms to define the character-encodings: <symbolic-name> <encoding> <comments> This form defines exactly one character and its encoding. <symbolic-name>...<symbolic-name> <encoding> <comments> This form defines a couple of characters. This is only useful for multibyte-characters, which are currently not implemented. The last line in a charmap-definition file must contain END CHARMAP. Symbolic Names A symbolic name for a character contains only characters of the portable character set. The name itself is enclosed between angle brack- ets. Characters following an <escape_char> are interpreted as itself; for example, the sequence <\>> represents the symbolic name > enclosed in angle brackets. Character Encoding The encoding may be in each of the following three forms: <escape_char>d<number> with a decimal number <escape_char>x<number> with a hexadecimal number <escape_char><number> with an octal number. FILES
/usr/share/i18n/charmaps/* CONFORMING TO
POSIX.2. SEE ALSO
locale(1), localedef(1), localeconv(3), setlocale(3), locale(5) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 1994-11-28 CHARMAP(5)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy