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
1 answer

Delete specific text from a file with PowerShell

I need to delete/replace specific text which is written on more rows and has blank rows between the lines of text. For example: some text text 1 other text text 1 I need to delete: other text text 1 The result will be: some text text…
ARB
  • 5
  • 3
0
votes
1 answer

change all author names in git repo imported from svn at once

I want to copy a large SVN repo and hash all committer/author names as they are confidential. I want to maintain the working repo, with all revision and be able to tell each committer apart but with a hashed(or obscured) author name. So far I have…
combatrock
  • 17
  • 6
0
votes
1 answer

Find all indented text

I want to find all text in a document that is indented by 8 spaces. The code below should find these lines and select the line for later processing. However, the code finds/selects all the lines unconditionally. What goes wrong? Do I have to reset…
olippuner
  • 394
  • 4
  • 16
0
votes
4 answers

How can compare a string with a text group with PHP

I have a string group like ("hello", "hi", "how r u", "how are you", "how r you", "how are u", etc.) and i want to create a function that can compare a string varible (like $varible = "Helloooo") with string group. Regex or any method is useful to…
0
votes
2 answers

Extract a certain string which can appear several times in a file

I have a text file that I want to read and extract a certain string (which can appear several times). Then I want to print the result. The string I'm trying to extract is the value of Rule MATCH Name. Text file example: 201819:34:40Z ubuntu : Info:…
bugnet17
  • 173
  • 1
  • 1
  • 12
0
votes
1 answer

Using backslashes in text replacement in AppleScript

I'm currently trying to create an AppleScript Application which will copy a folder from its "Contents" folder to the user's desktop. The code I have at the moment is: set theFile to path to me as string set hfsme to theFile & "Contents:Folder" set…
Tom
  • 159
  • 1
  • 7
0
votes
2 answers

Python: Indenting Output Text

I'm writing a script and one of the things it can do is retrieve dictionary definitions from online resources such as: en.wiktionary.org. I'm using the tab character to prepend each string with an indent, so as to separate the dictionary…
voices
  • 495
  • 6
  • 20
0
votes
2 answers

Text comparison in Dynamics Nav "C/AL"

I would like to know if a text ends in '0000' in C/AL code, but I am not sure if I am doing something wrong or the documetned functions simply are not prensent in the version of NAV I am using (NAV 2016). String Functions in NAV In any case I would…
Immac
  • 466
  • 1
  • 5
  • 16
0
votes
5 answers

Splitting a line up into 2 different strings

So I have a file where a bunch of coordinates are in. But one x has its y value in the same line just seperated by a space. How do I split each line into two seperated pieces up so that I get the y and the x coord seperate(eg in a strig…
jonas
  • 164
  • 1
  • 11
0
votes
0 answers

How do I replace a string in nth line of a huge text efficiently?

I have a CSV file which is around 3 GB having 20 million lines. I am trying to replace a string in a line using sed but it takes around 12 minutes on my i5 processor with 4GB RAM. This is the command I am using right now. sed -i…
Amir
  • 1
0
votes
1 answer

How do I remove parts of strings using stringr and rebus?

I would like to use stringr and rebus to remove parts of strings in a dataframe. Specifically, I would like to remove the part where it starts with a space and a number till the end. The following is my dataframe: df<-data.frame(ID = 1:8, Medication…
HNSKD
  • 1,614
  • 2
  • 14
  • 25
0
votes
0 answers

Split XML line in bash ignoring spaces in quotes

I've seen some suggestions to use eval, but that assumes the quoted text is an entire string in itself, and not part of one. Simple example: Split the string So that we get Is this…
michjnich
  • 2,796
  • 3
  • 15
  • 31
0
votes
2 answers

Keyword Analyser

I want to know any algorithms or php code for working out keyword competition. The keyword can be used multiple sites per website and on multiple websites. I want to know how its ranking can be worked out. Thanks
Speedy Wap
  • 478
  • 4
  • 7
  • 18
0
votes
5 answers

Bash: in directory `directory_name.git`, how to cd to `../directory_name`?

I'm pretty new to Bash scripting and am looking to do the following: The script's pwd is "/a/b/c/directory_name.git/" and I'd like to cd to "../directory_name" where directory_name could be anything. Is there any easy way to do this? I'm guessing…
Olivier Lalonde
  • 19,423
  • 28
  • 76
  • 91
0
votes
2 answers

Dynamic continuous numbering in bash

I have a text file that acts as a database for my script. The file has a column for an "ID" in example. The database has a format of UID:Item Name:Quantity:Price:Date Added cat FirstDB.txt output: 0001:Fried Tarantula:45:100:2017-08-03 0002:Wasp…