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
0
votes
4 answers

Find command in python catches only first line

Trying to grab the magnet link from the following code rawdata = '''
SamFlynn
  • 369
  • 7
  • 20
0
votes
2 answers

How to add style attribute to all cells of a coloumn in a HTML table?

So I have a huge HTML Table, some of which I've inserted here below: Name Language Pages Author Publisher Category Class…
Vaibhav
  • 15
  • 2
0
votes
1 answer

Change the value of a character entered in a textfield

For example, I've got the below code where I'm trying to interpret just any character entered into the textfield as the first element from my arrayOfCharacters. This sort of works however on entering a second character, doesn't function. I was…
0
votes
2 answers

Text manipulation in Java

I have a string with this format: "key=some value|otherkey=other value|key3=yet another value" I need to create a function with this signature: public String update(String all,String key, String value) Where all is the previous string, key the…
Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
0
votes
2 answers

Python proprietary file conversion loop

Currently working on an EDI translation for a proprietary file format. The input file may have hundreds to thousands of records. Each line is a record. INFILE:(Ignore beginning blank line, it's only there for visual representation)…
AtomicDog
  • 79
  • 2
  • 2
  • 8
0
votes
1 answer

Powershell: count equal lines in txt file

I need to count the lines with Powershell which are equal in a text file. Also I want to output the lines which appears two or more times just once with the count of occurrences Example: My text file: WD WD3001BKHG-02D22,279.46 GB,SAS,u0 WD…
mabu
  • 286
  • 8
  • 26
0
votes
1 answer

How to use wmic in order to generate a txt with many columns

I'm using wmic qfe get HotFixID >> WindowsUpdateVersion.txt in order to export a list of KB{num}. I am looking for a command to reshape this list in many columns (3 or 4 columns, .txt or .xls, not important). I have already tried with wmic…
Matteo
  • 3
  • 1
0
votes
2 answers

Batch modifying text.txt before a specific word

I have a file.txt where there are lines as IF TANK T395 LEVEL ABOVE 4 THEN PUMP PFALDA395&T395 STATUS IS CLOSED that I would like to transform in IF TANK T395 LEVEL ABOVE 4 THEN PUMP PFALDA395&T395 STATUS IS CLOSED …
Sandra
  • 13
  • 4
0
votes
2 answers

Combining many files with matching fields in particular column to a single file

So I have 128 files with two columns. I want to match them by the values in the first column and add the values in the second column from each file to a single file. I was able to kinda of find a solution here: From:…
Talon
  • 3
  • 2
0
votes
1 answer

Remove redundant braces from code

I am trying to use tr command or any similar command to perform a specific text manipulation to this block: if (/*condition*/) { statement1; } int a=3; if (a) { statement1; statement2; } else { statement1; statement2; …
Mostafa Bahri
  • 2,303
  • 2
  • 19
  • 26
0
votes
6 answers

Is there a Windows utility that will let me do multiple programmatic find/replaces on text that I cut & paste into it?

I've inherited some C# code that contains about a thousand lines of source that I need to modify, transforming it from this: newDataRow["to_dir"] = comboBox108.Text; To this: assetAttributes.Add("to_dir", comboBox108.Text); The lines occur in…
billmaya
  • 1,311
  • 3
  • 15
  • 34
0
votes
2 answers

Extracting ID and sequence from a FASTQ file

I'm trying to manipulate a Fastq file. It looks like…
0
votes
2 answers

bash text manipulation from comma delimited variable to list

I'm a novice at manipulating text in bash and appreciate any suggestions! I have a variable used early in a script that is formatted like this: runlist=echo 10,19,25,32 The actual numbers and how many numbers there are listed out differ on various…
JaYbirD
  • 3
  • 2
0
votes
0 answers

Batch file to remove text between 2 characters

Is it possible to write a Windows batch file that can delete all text between 2 characters, including the characters themselves? I am dynamically generating text files that includes a piece of text in HTML format. I want to extract only the…
Guhan Murugesan
  • 89
  • 1
  • 1
  • 8
0
votes
2 answers

Ruby conditional map and replace

I'm trying to conditionally map an array I have: Array that looks like [ "a", "b", "c" ] I want to map it inline (using map!) to change anything that matches /b/ and change it to "bb". This doesn't seem to work though, it doesn't seem to be changing…
awojo
  • 907
  • 3
  • 11
  • 21