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
6
votes
2 answers

Get latest 100MB Of text file in linux

How do I get the latest 100MB from a text log on Linux? Is there a tool for it, or could you point me on a script? I have no programming experience on Shell Scripting, Perl or Python, and I don't want to install mono so I can write it in…
friedkiwi
  • 2,158
  • 8
  • 29
  • 52
6
votes
7 answers

Remove text between quotes

I have a program, in which you can input a string. But I want text between quotes " " to be removed. Example: in: Today is a very "nice" and hot day. out: Today is a very "" and hot day. Console.WriteLine("Enter text: "); text =…
Jolek111
  • 89
  • 1
  • 7
6
votes
6 answers

how to create exclamations for a particular sentence

I would like to create exclamations for a particular sentence using the java API? e.g. It's surprising == Isn't it surprising! e.g. It's cold == Isn't it cold! Are there any vendors or tools which help you generate exclamations, provided you give…
user339108
  • 12,613
  • 33
  • 81
  • 112
6
votes
2 answers

Splitting a string with no line breaks into a list of lines with a maximum column count

I have a long string (multiple paragraphs) which I need to split into a list of line strings. The determination of what makes a "line" is based on: The number of characters in the line is less than or equal to X (where X is a fixed number of…
Karim
  • 18,347
  • 13
  • 61
  • 70
5
votes
1 answer

Convert numbers to words with VBA

I have a column of numbers. In the next column, I want the text/word conversion of the numbers. Example: 123.561 would convert to One hundred twenty three point five six one. I do not want to convert to currency, just number to text, with any…
Aman Devrath
  • 398
  • 1
  • 3
  • 21
5
votes
4 answers

put all separate paragraphs of a file into a separate line

I have a file that contains sequence data, where each new paragraph (separated by two blank lines) contain a new sequence: #example ASDHJDJJDMFFMF AKAKJSJSJSL--- SMSM-....SKSKK ....SK SKJHDDSNLDJSCC AK..SJSJSL--HG AHSM---..SKSKK -.-GHH and I…
brucezepplin
  • 9,202
  • 26
  • 76
  • 129
4
votes
2 answers

Reversing Text to Columns in Excel/Calc

Most spreadsheet software I've used has a text-to-columns function that splits a single column into multiple columns using several criteria (delimiter, # of character, etc). I want to do this in reverse. I know I can use a formula to create a third…
Lee Blake
  • 341
  • 1
  • 2
  • 15
4
votes
5 answers

How to capitalize some words in a text file?

I have a text file which have normal sentences. Actually I was in hurry while typing that file so I just capitalized the first letter of first word of the sentence (as per English grammar). But now I want that it would be better if each word's first…
Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
3
votes
1 answer

How to I set a symbol inside the record separator of awk

How do I include symbols into the record separator of awk. I know the basic syntax like this: awk 'BEGIN{RS="[:.!]"}{if (tolower($0) ~ "$" ) print $0 }' which will separate a single line into separate records based on ! . and : but I also want to…
Ardie
  • 35
  • 3
3
votes
2 answers

Text Searching and Manipulation

So the file I am importing into a ListBox looks like this (each newline is a new item in the ListBox): C2 CAP-00128G 238.385 205.944 0 0402_8 C1 CAP-00128G 236.260 204.844 0 0402_8 //Same as above 1 (C2) C18 CAP-00129G 230.960 190.619 0 …
theNoobGuy
  • 1,636
  • 6
  • 29
  • 45
3
votes
0 answers

Retaining paragraph numbering in docx using the R officer package

How can I retain the numbering of paragraphs when extracting text from a docx file? I'm doing some NLP-ML work on a bunch of docx files, and to begin with I need to break up each doc into a dataframe. I'm working with contracts, such that almost…
mendy
  • 329
  • 1
  • 9
3
votes
2 answers

How to extract text between two substrings from a Python file

I want to read the text between two characters (“#*” and “#@”) from a file. My file contains thousands of records in the above-mentioned format. I have tried using the code below, but it is not returning the required output. My data contains…
BiSarfraz
  • 459
  • 1
  • 3
  • 14
3
votes
2 answers

Get the first letters of words in a sentence

How I could get the first letters from a sentence; example: "Rust is a fast reliable programming language" should return the output riafrpl. fn main() { let string: &'static str = "Rust is a fast reliable programming language"; …
ysKnok
  • 41
  • 5
3
votes
1 answer

How to truncate HTML string, to be used as a "preview" version of the original?

Background We allow the user to create some text that will get converted to HTML, using a rich-text editor library (called Android-RTEditor). The output HTML text is saved as is on the server and the device. Because on some end cases, there is a…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
3
votes
8 answers

extract value of an assignment expression

Suppose I have this string: a b c d e=x f g h i What's the best* way to extract the value x from e=x using only Linux commands (like sed and awk)? *The definition of "best" is up to you.
cd1
  • 15,908
  • 12
  • 46
  • 47
1
2
3
15 16