Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I need to replace certain letters in a word with a character.
I'm stuck. How can I fix it?
It looks like you already have most of the code. You just need to add the letters that don't need to be replaced and are not in the consonants list.
To do this, I would use an if-else instead of an if in your loop. This will allow you to replace letters that are in the consonants list and add letters that don't need to be replaced to the final word.
It would look something like this:
Note that the consonants list has the characters that are to be replaced in word word.
This should give you what you are looking for.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to append lines to the previous line if the blank line is followed by the line.
For example:
A
B
C
1
D
E
B
Ouput:
A
B
C
1D
EB
See also Håkon Hægland's comment above. This is one of those problems that lends itself to treating the whole file as one long string (with embedded newline characters). Perl has a flag -0 for changing or turning off the default "record separator" definition that accomplishes this. Then you just need to realize that, depending on your definition of "blank line", you seem to be requesting that all sequences of two or more newline characters in a row simply be removed. (If your definition of "blank line" can include lines with blank characters on them (whitespace, i.e. spaces and tabs), you'll need a more complicated expression.) This compact one-liner will do it:
$ perl -0pe 's/\n\n+//g' blanklines
A
B
C
1D
EB
Now please tell me this was not a homework assignment.
Update: I realized a couple of additional things. 1) Since newline is included in Perl's whitespace special escape \s, expanding to handle the case of blank lines having blank characters on them is not really more complex: perl -0pe 's/\n\s+//g' blanklines. 2) There is an edge case that this solution doesn't handle right: blank lines at the end of the input. I'll leave that as a problem for the student. :-)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
Hi my problem is everytime I use excel and place an E in the cell with numbers it turns it into a mathematical equation.
Example: 6807E02 turns to 6.81E+05. Totally driving me insane. Someone please help me?
This is happening because Excel assumes you are entering a number using a variant of scientific notation called E Notation. When you enter 6807E02, Excel assumes you are talking about the number 680,700 (6807 x 10 ^ 2). Excel has it's own method of formatting scientific notation, which is to always put the decimal to the right of the first digit, and end with the E (the multiple of 10) to the far right. That's why you're seeing 6.81E+05 (the display rounds to two digits after the decimal, but the number is still the same).
If you're intentionally trying to type in the text value "6807E02", you can either set the cell's data type to "Text" (Image below), or you can type the single apostrophe key (') before you start entering the number. If you want the number you typed in, but you don't want Excel to override your number formatting, that's unfortunately beyond my abilities. Excel is pretty stringent with custom formatting when it comes to Scientific Notation. You would probably end up spending far more time trying to force Excel to accept your notation as a custom format than the value doing so would add to your project.
Hope this helps!
Hi this link should help you,
From what I can see the easiest solution would be if you put an apostrophe (') in front of the number excel will treat it as text.
For example '6807E02
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
i am looking for a mapping table or Perl module or anything else, which makes it possible to map characters to a URL safe version that is also readable.
I need to build URLs without any special characters. The base words are city names in their native language which means it can contain special characters from that language.
For example, when i have something like the polish city name 'łódź' i need to get a readable version like: 'lodz'
The major browsers show and accept non-ASCII characters in the URL bar even if they need to be encoded during transmission.
For example,
http://.../city/Montr%C3%A9al
will appear as
http://.../city/Montréal
in the browser's URL bar. [Test]
But if you want to convert to a subset of ASCII, you'd start by using Text::Unidecode's unidecode. Then you gotta decide what to do with the characters that must be escaped in URLs.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Do you know how to look for special characters with google...?
I'm looking at bash code and there's the ## operator. I would like to know what It does but I wasn't able to figure out a way to protect the character (I'm not sure it's even possible).
This is particularly annoying when you're looking for some code patterns, some characters are always ignored.
Update: this answer is no longer applicable as of 2017. See https://blog.google/products/search/improvements-searching-special-characters-programming-languages/
Google strips most punctuation from queries, as described here, so it won't help you with the bash syntax.
It's very easy to search for the string "##" in the bash documentation: Just run "info bash", hit "s", and enter "##" as the search string.
google strips puntuation, imho, because:
it's somewhere used for special search (chars like - to exclude, +to add and 10..20 to specify a range)
to avoid spammers to get email addresses (characters like # or .)
in my experience, it's even impossible to escape special characters.
the only solution I found, by now, is using yahoo http://it.search.yahoo.com/
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
I'm looking for a good character that means "end-of-story" in unicode. I remember seeing one once that looked like a fractal and was really cool. Does anyone know where I can find this character? More importantly, where can I go to find a unicode character with a special meaning when I don't know it's names? Google wasn't very helpful.
Edit: I found something that looks kinda like a fractal, and also happens to be called "end-of-story." It's a Thai character.
Is this what you were looking for?
http://www.decodeunicode.org/en/u+0e5b/data/k//XS/khomut31910809.jpg
End of story The Khomut sign is a terminal punctuation character which is placed in old books at the end of a verse in a poem, the end of a chapter or at the end of a story.
Compare to U+17DA Khmer Sign Koomuut
Btw: I found this with a Google Image Search on "end of story" unicode--It was the 4th result. That's probably the best way to search for any kind of symbol. Though without the name of the character it would probably have been impossible to find, since unicode fractal didn't return anything useful.
Go and have a look at the unicode.org code charts. You can browse through them and find a character that you like by what they look like. http://www.unicode.org/charts/
Alternatively, browse through the names of the characters using the data file that has the official character name. Do a search using your browser or editor search function. http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt
When you find a character that you want to see what it looks like, just do a search for the character code. e.g. character 0087 (the first field in the UnicodeData.txt file) is searched as U+0087. FileFormat.info usually has all of the characters. For example, END OF SELECTED AREA.
Are you using Windows? Use the Character Map (Start | Accessories | System Tools). I personally like the Greek Omega (U+03A9) or the Ohm sign which is an Omega (U+2126).