Questions tagged [text-manipulation]

Text/String manipulation is the term used to describe various operations applied to strings and/or text.

Text/String manipulation is the term used to describe various operations applied to strings and/or text. Often used with Regex or replace functions, concatination, etc.

237 questions
3
votes
2 answers

Insert text on the current place of the cursor in the browser

I have a modal window which helps formatting text. I have multiple textareas on the window. The modal should not be attached to a specific textarea, so when I press an Icon in the modal window, I need to insert a string/emoticon etc where-ever the…
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
3
votes
2 answers

Decoding unknown encoded Traditional Chinese character strings using Python

Hi I have a website that is in Traditional Chinese and when I check the site statistics it tell me that the search term for the website is å%8f°å%8d%97 親å­%90é¤%90廳 which obviously makes no sense to me. My question is what is this encoding…
boobami
  • 101
  • 2
  • 11
3
votes
1 answer

Convert Chinese characters in Percent-Encoded URI string to Chinese characters in UTF-8?

Okay, I am not sure if I am phrasing this correctly but I am given url in the following form: http://zh.wikipedia.org/wiki/%E5%A4%A9%E6%96%87%E5%AD%B8 but I would to convert it into Chinese characters like so: http://zh.wikipedia.org/wiki/天文學 what…
boobami
  • 101
  • 2
  • 11
3
votes
2 answers

Transforming a sentence creates an infinite loop - but how?

I can't figure out where this is going wrong. Please note that I am very new to Prolog and I'm sure I'm missing something - just no idea what that might be. Could anyone help me out please? Thanks, here is my code: printSentence([]). …
rtheunissen
  • 7,347
  • 5
  • 34
  • 65
2
votes
2 answers

How does one merge texts together? like a version control system would?

Wikipedia says this is pretty good: http://en.wikipedia.org/wiki/Merge_(revision_control)#Three-way_merge But how does one implement that? or are there any gems / plugins for Ruby on Rails that will handle that for me? My situation: • I have base…
NullVoxPopuli
  • 61,906
  • 73
  • 206
  • 352
2
votes
1 answer

A macro to convert a SQL query to a string concatenation and viceversa?

I'm working with Access and I have many queries in the code like "SELECT something, something " _ & "FROM the_table " _ & "WHERE something Is Null " or "SELECT " & _ "Min(something), " & _ "Max(something2) " & _ "FROM (the_table " & _ …
rubdottocom
  • 8,110
  • 10
  • 39
  • 59
2
votes
3 answers

How to slice off a string in Ruby using another string?

Say I have a sentence similar to the following: The quick brown fox jumps over the lazy dog I'd like to slice off everything before and including "jumps", so I am left with: over the lazy dog Currently, I get the index of the part I'd like to…
Yuval Karmi
  • 26,277
  • 39
  • 124
  • 175
2
votes
2 answers

Are there any text-manipulation-tools specialized in source code?

Are there any free and open text-manipulation-tools for the command-line specialized in source code? I especially would love a feature where I could just add a new method stub automatically or remove methods by name altogether. Automatic…
2
votes
1 answer

Find All String Occurrences, Except The Last One Found, and Remove Them

I am using Google Docs to open Walmart receipts that I email to myself. The Walmart store that I use 99.9% of the time seems to have made some firmware update to the Ingenico POS terminal that makes it display a running SUBTOTAL after each item is…
ONDEV
  • 566
  • 3
  • 7
  • 15
2
votes
1 answer

extract only words that do not contain words ending with a particular letter combination (using regex only)

I have this list of Portuguese language words https://raw.githubusercontent.com/pythonprobr/palavras/master/palavras.txt. I want to extract only words that do not end in "er" or "ar". I have been trying to apply the methods in the answers to this…
7beggars_nnnnm
  • 697
  • 3
  • 12
2
votes
1 answer

Find url in plain text and insert HTML A markups

I have text with URL and I need to wrap them with HTML A markup, how to do that in c#? Example, I have My text and url http://www.google.com The end. I would like to get My text and url http://www.google.com The…
Tomas
  • 17,551
  • 43
  • 152
  • 257
2
votes
1 answer

String replacement in OCR'd purchase receipts

What I have is an OCR'd Walmart receipt in a Google Document (Walmart allows you to email to yourself a .jpg version of your receipt, and this image can be opened with Google Docs, during which it applies OCR to extract text. The result is excellent…
ONDEV
  • 566
  • 3
  • 7
  • 15
2
votes
2 answers

Convert std::string to FString (TCHAR / wstring) with special characters

Using Unreal Engine 4, I want to load a file from the machine, which contains characters like “, ”, ‘ and ’. All conversion attempts result in the final FString either containing ? in their place, or no character at all. FString is UE4's internal…
2
votes
2 answers

N-gram analysis based on impression in Python

This is how my sample dataset looks like: My goal is to understand how many impressions are associated with one word, two words, three words, four words, five words, and six words. I used to run the N-gram algorithm, but it only returns count. This…
Ran Tao
  • 311
  • 1
  • 4
  • 13
2
votes
5 answers

vim: substitute specific character, but only after nth occurance

I need to make this exercise about regexes and text manipulation in vim. So I have this file about the most scoring soccer players in history, with 50 entries looking like this: 1 Cristiano Ronaldo Portugal 88 121 0.73 03 Manchester…
zeno dhaene
  • 245
  • 3
  • 14
1 2
3
15 16