tr Questions

2

Solved

I want to remove diacritic signs in some strings. tr/// should do the job but fails (see below). I thought I had an encoding/decoding problem, but I noticed s/// works as I expect. Could somebody e...
Unbreathed asked 23/10, 2016 at 15:11

3

Solved

I am trying to replace a pipe character in an String with the escaped character in it: Input: "text|jdbc" Output: "text\|jdbc" I tried different things with tr: echo "text|jdbc" | tr "|" "\\|" ....
Catania asked 3/8, 2016 at 13:46

3

Solved

I'm pulling some data from a database and one of the strings I'm getting back is in one line and contains multiple instances of the string \n. These are not newline characters; they are literally t...
Conservancy asked 26/7, 2016 at 21:5

2

A console program (translate-shell) has an output with colors and uses special decorate characters for this: ^[[22m, ^[[24m, ^[[1m... and so on. I'd like to remove them to get a plain text. I tri...
Rajput asked 23/8, 2015 at 13:8

1

I found this example in a Perl tutorial, but could not understand the output. The tutorial says: The /d modifier deletes the characters matching SEARCHLIST that do not have a corresponding...
Betimes asked 22/8, 2015 at 22:7

5

Solved

Can tr replace one character with two characters? I am trying to replace "~" with "~\n" but the output does not produce the newline. $ echo "asdlksad ~ adlkajsd ~ 12345" | tr "~" "~\n" asdlksad ...
Pola asked 21/8, 2013 at 18:55

1

Solved

I have a set of several hundred .txt files that I am analyzing (ngram analysis using NSP), and I need to remove all the line breaks from each file. I can do it one at a time using tr: $ tr -d "\n\...
Spruce asked 7/10, 2014 at 3:18

5

Solved

Let say pattern is string "Love" input This is some text Love this or that He is running like a rabbit output This is some text Love this or thatHe is running like a rabbit I've noticed that...
Extremity asked 20/9, 2014 at 0:34

1

Solved

Have output from sed: http://sitename.com/galleries/83450 72-profile Those two strings should be merged into one and separated with space like: http://sitename.com/galleries/83450 72-prof...
Selfevident asked 13/9, 2014 at 19:17

2

Solved

my file contains lines such as these: -A INPUT -m state --state NEW -m tcp -p tcp --dport 2000 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 2001 -j ACCEPT -A INPUT -m state --sta...
Swath asked 22/7, 2014 at 9:37

9

Solved

Giving the string: foo='Hello \ World! \ x we are friends here we are' Supose there are also tab characters mixed with spaces after or before the \ character. I want to replace the spaces, t...
Atmospheric asked 28/2, 2014 at 23:22

1

Solved

My objective is to match email addresses that belong to the Yahoo! family of domains. In *nix systems (I will be using Ubuntu), what are the benefits and drawbacks to any one of these methods for m...
Inextinguishable asked 7/4, 2014 at 22:49

1

Solved

I'm having a little trouble with find and exec in bash: Suppose I have a bunch of files that I need to replace '\r' characters in. (previous question: Joining Columns on Command Line with Paste o...
Chisholm asked 31/3, 2014 at 17:50

1

Solved

I have this script on my system: #! /bin/grep cat caterpillar cat lol morecat When I run it, I get the output as expected, #! /bin/grep cat caterpillar cat morecat But, if I use tr instead, ...
Sickler asked 15/3, 2014 at 20:29

4

This is the command I'm using on a standard web page I wget from a web site. tr '<' '\n<' < index.html however it giving me newlines, but not adding the left broket in again. e.g. echo &q...
Sibeal asked 1/12, 2011 at 23:19

1

Solved

I am trying to manipulate a text file and remove non-ASCII characters from the text. I don't want to remove the line. I only want to remove the offending characters. I am trying to get the fo...
Eunaeunice asked 22/2, 2013 at 23:26

5

Solved

I have to replace the newline character with ',' for using in some oracle command but in a single command. I can't figure out how to do it. Input: R1 R2 R3 R4 Required Output: 'R1','R2','R3','...
Haematogenous asked 24/12, 2012 at 5:25

2

Solved

Right now I'm using another text file to store the result of one UNIX command and then using that file to run another command, like so: tr -d "[,|.]" < text > temporary.txt tr "[A-Z]" "[a-z]...
Astrakhan asked 31/8, 2012 at 1:14

5

Solved

Id like to convert it to uppercase for the simple purpose of formatting so it will adhere to a future case statement. As I thought case statements are case sensitive. I see all over the place the t...
R asked 22/6, 2012 at 15:13

5

Solved

Is it possible to delete a specific string with tr command in a UNIX-Shell? For example: If I type: tr -d "1." and the input is 1.1231, it would show 23 as an output, but I want it to show 1231 ...
Aureus asked 23/4, 2012 at 14:29

2

Solved

I have been reading the cookbook for Linux to get a hang of it. I am fairly new to it. I cam across a topic called Concordance of text. Now I understand what it is, but I am not able to get a seq...
Griskin asked 29/1, 2012 at 21:10

6

Solved

I have a file named file1 with following content: The answer t o your question A conclusive a nswer isn’t al ways possible. When in doubt, ask pe ople to cite their so urces, or to explain Eve...
Sawtoothed asked 18/11, 2011 at 5:40

3

Solved

Our bespoke IDE outputs XML files with an encoding that makes them look like binary files. Diffs and merges of these files fail. We can create ASCII versions of these files with the tr command. I ...
Jovi asked 29/6, 2011 at 7:33

1

Solved

There is something mysterious to me about the escape status of a backslash within a single quoted string literal as argument of String#tr. Can you explain the contrast between the three examples be...
Huckaback asked 8/5, 2011 at 8:43

© 2022 - 2024 — McMap. All rights reserved.