Skip to main content

Questions tagged [substring]

Part of a string, or the function/method that returns part of a string

Filter by
Sorted by
Tagged with
1 vote
1 answer
52 views

Join two df and cut second df field by first df field condition during join?

I have two df - first contains start and end position, like id start end 1 4 8 2 2 6 2 5 7 And second df with id-string id string 1 my beautiful data 2 lorem ipsum Join &...
user453575457's user avatar
1 vote
1 answer
48 views

Convert optional substring to string in Swift

Apple's documentation and many articles suggest you can convert a substring (string.subsequence) to a string just by calling String(substring)and in fact this works. let str = "Hello world" ...
user6631314's user avatar
  • 1,867
0 votes
1 answer
68 views

Need help in using SQL split by delimeter, and get data from another table from the results of split data [duplicate]

I have 2 Tables Table -1 Soltid SlotName Amount 1 Slot-1 100 2 Slot-2 150 3 Slot-3 150 4 Slot-4 125 5 Slot-5 100 6 Slot-6 100 7 Slot-7 150 8 Slot-8 125 9 Slot-9 100 10 Slot-10 150 11 Slot-...
Sathesh Kumar's user avatar
-1 votes
1 answer
39 views

How to find the longest subsequence containing all vowels in order in a string in Python?

I am working on a problem where I need to find the length of the longest subsequence in a given string that contains all the vowels (a, e, i, o, u) in order and no vowels out of order. The vowels can ...
Vokekov's user avatar
0 votes
1 answer
37 views

How to Parse text in one column to different columns in TSQL?

I have data in the following format in a column: Follow-up Date (use start date from OTO): 8-15-2024 Contract Type (Competitive Win, Meter, New Product Line, Not Eligible): Meter Go Live Date (...
Monu M's user avatar
  • 1
0 votes
0 answers
19 views

Cut a number from row and insert into new column

I have a table where one column contains a long description with a street number and I want to pick that value , like we have three rows below: Streetnum_12345678 /*+ INDEX(@"SEL$EECA6CD9" &...
saurav kumar's user avatar
0 votes
0 answers
17 views

Extract alphabetic_string from a field in Teradata

I have a table (table1) with some columns say (col1, col2, col3). I am trying to extract alphabetic_string from col1. The example data in Col1 is ABCDEF, GON-F RFF RED, IV CATH INTRO 22G X 1", BD ...
Animesh Jain's user avatar
0 votes
1 answer
52 views

How to extract a substring from a label value in promql?

I have a Prometheus metric as shown below query_duration{query = "SELECT * FROM TABLE_NAME"} I'm trying to extract only TABLE_NAME from the label query. I'm trying to use regex to extract ...
dev333's user avatar
  • 769
4 votes
7 answers
265 views

Extract a substring without using regexes - PostgreSQL

This is based on a question previously asked which was deleted by the OP but it got me thinking and playing round with it, and I managed to do it without using a regex (only (I)LIKE() % or _ allowed). ...
Vérace's user avatar
  • 876
0 votes
1 answer
41 views

How to find the substrings in MongoDB

I have data in my db in the form: {term: "Hello how"}, {term: "whoever"}, {term:"what"} I have an array of strings like: ["Hello how are you", "whoever ...
Mahes's user avatar
  • 1
-1 votes
1 answer
72 views

Shortening a string in rust for the purpose of debug display

I'd like to shorten some strings for a (debug) display method on a struct. In this example the user_id member is a long UUID and I don't want to print all of it if it would exceed one line, so I'd ...
AlexKing's user avatar
  • 131
0 votes
0 answers
34 views

NGINX: map $request_body

I have $request_body with some string like: auth.user=AABBCC&auth.id=DDFFGG&cmd=login&return_to=site.com&id.required= I need to write log only with user name from this string (in ...
user25346359's user avatar
0 votes
1 answer
21 views

postgresql getting data between characters : and ] differing lengths of data between characters

New to data mining like this. My first post. Apologies if I did something wrong. This is my data in the field. I cannot use length because I have different formats and lengths in the data. [PICK] [...
LApd2024's user avatar
-1 votes
2 answers
30 views

How to figure out what string was inserted somewhere into a known other string?

I’m looking for the most straighforward way to figure out which string was inserted somewhere into a known other string. Here’s what I have to work with: I have an existing variable representing a ...
Ashley Bischoff's user avatar
0 votes
1 answer
49 views

xpath for multiple nodes selecting substring have an invalid token

xml document containing comment in comments node as: <Comments> <Comment>09/28/2021 22:21:31user1 [1] file uploaded </Comment> <Comment>09/28/2021 22:22:47user2 [2] ...
Aysha Khan's user avatar
-2 votes
1 answer
53 views

Get part of string with regex/ sql substr [closed]

I'm tying to extract a part of my string: output Fullstring Expected Result xi xi-AN224432_-_this_is_some_text-x10.pdf AN224432 or AN224432_ F1800X7T2P5P xi-F1800X7T2P5P-blahblah-v01_00-EN.pdf ...
guess_work0205's user avatar
0 votes
2 answers
82 views

Using Pandas, make a new column from the string slice of another column -- getting NAN

I want to create a new column from an extracting Data Frame (DF) column. All my testing indicates the values I am using are correct and should produce a level1 value vs NAN. Help! CODE SNIPPET: import ...
user25137531's user avatar
0 votes
2 answers
56 views

How to remove string + n preceding characters from pandas dataframe

I have a dataframe that looks like the following: Group Attribute Text 1 A 'The ball is red456placeholder' 1 A 'I like pizza985placeholder.' 2 A 'Fire bad ...
user2813606's user avatar
0 votes
2 answers
44 views

Check for a substring containing a space in a string in a dataframe

I'm trying to remove rows that contain string based on the string value. To do, I'm looking for specific substring within the strings. My issue comes from the fact that those substrings contain spaces ...
Amac's user avatar
  • 1
-1 votes
3 answers
88 views

Multiple substrings in string python within variable check [duplicate]

I have the following code: check = "red" in string_to_explore How can I replicate it for multiple substrings? I tried with: check = "red|blue" in string_to_explore but doesn't ...
iraciv94's user avatar
  • 820
0 votes
1 answer
40 views

Find the file extension from file name passed into powershell as a string argument

I am an absolute beginner with PowerShell, With a pair of PS1 files. The first one does a couple of basic checks, and will then Launch a file whose full path has been passed in as a string. $args[0] ...
dmhzx's user avatar
  • 51
0 votes
2 answers
31 views

PL/SQL finding values from a table within a string

I have a table with a column with the following values: COWS SHEEP GOATS CHICKENS I have another table with string rows that look like ID STRING 1 PINK 2 SAUSAGES I want to search within the ...
WanderingMushroom's user avatar
-1 votes
1 answer
67 views

Extracting multiple strings starting with specific characters from single row

I have a table in which one of the columns has large XML data. I want to extract strings which start with SAP (upper case) (Eg: SAP-PTS-RSK-SEC-A-006-GFC). These strings appear on multiple instances ...
Alphin Joshua's user avatar
0 votes
2 answers
83 views

kdb/q How do I split a column into two by the first 6 characters?

My table has a column like this: DateName 2024.01.01Ann 2024.01.02Bob 2024.01.03Ant I want to be able to split this column into two, where the first one is the Date from DateName and the second ...
mmv456's user avatar
  • 13
0 votes
1 answer
54 views

Find and remove ASCI values from varchar

Context Reading from CSV files using SQL Server 2016 (no format option available). The files are crlf/windows and each value will be wrapped in double quotes. Files are located here, note that I ...
Urasquirrel's user avatar
  • 1,555
0 votes
0 answers
35 views

Problem with substring in XML modify method

I want replace one value with another in XML value. What i need is to use a substring method: UPDATE zamowienia_xml SET tresc_xml.modify(' replace value of (/zamowienie/profil_rabatowy/rabat/text()...
Marcin Knapik's user avatar
1 vote
3 answers
94 views

How to delete the numbers between two delimiters?

I have some garbage data: trueText = ' 23  Wolkenvelden en   lokaal wat regen. In  de ochtend op  steeds meer  plaatsen ...
Ray004's user avatar
  • 25
0 votes
1 answer
49 views

extracting the instances of numeric value in dataframe

In each of the dataframe, I have a row entry that looks like: [{'degree': 0.1, 'name': 'Colins Dental Clinic', 'rating': 9, 'level': 'fourth'}] It is a direct import from read.csv of a file. I would ...
Frank Swanton's user avatar
1 vote
2 answers
46 views

Extract substrings from dataframe column, insert into new column as integers

I have a dataframe, 'sp', with a column, 'RouteIdentifier', which contains a state route and additional noise. I want to get the numerical substring from each row, preferably without leading 0s, and ...
J. Sizzler's user avatar
0 votes
0 answers
14 views

Remove part of string starting from right [duplicate]

i'm using T-SQL and i want to remove part of a string, starting from the right side until (and including) the first hyphen, for example: OBE-7777-1234 --> OBE-7777 but it could also include just ...
Dave28's user avatar
  • 1
0 votes
6 answers
60 views

Extract substring between a : and a string of a predefined set of strings

I have the following input as a a column of a df, each row is one string: surname: Chardon firstname: Marie occupation: idem link: fille age: 30 surname: Lhopital firstname: Louis-Jean occupation: sp ...
CrazyTiger's user avatar
1 vote
4 answers
128 views

How to extract symbol (<<) and its corresponding alphabets from a string with sed, awk or grep

DNA covariance model single/one file : Input data Header : sequence and covariance NC_013791.2.2 : GCTCAGCTGGCtAGAG NC_013791.2.2 : >>>>.........<<< NC_013791.2.3 : ...
Pandu C's user avatar
  • 41
0 votes
1 answer
19 views

Change Background-Color of portion of Text with Closedxml in Excel

Is there a way to change the background-color of a part of the text inside a cell? im aware of the richttext functions to change text-stylings but could no find anything for the background-color. I ...
jakob Ruedisser's user avatar
0 votes
3 answers
170 views

C# how to remove the rest of a string after specific character

How do I remove everything in this string after the second - (not the first one)? P037315F1-FB12-40-Fully Threaded MSB HOT DIP GALVANIZED I need the result to be P037315F1-FB12
AnyName35425's user avatar
0 votes
3 answers
60 views

Separate a column in different columns depending on a label

I have a dataset in which one of the columns have a string as value. The string has this kind of aspect: F: whatever; F: whatever; P: whatever; P: whatever; C:whatever; C: whatever; I want to separate ...
Isidro Sobrino's user avatar
1 vote
1 answer
38 views

How to remove between only the first two matching patterns in a string?

Say I have x x <- 'This is the <span I want to remove this> text I would like. But we must check I can have another chevron, >, in the string.' and I want x <- 'This is the text I ...
tiredmonk's user avatar
0 votes
0 answers
30 views

Shell substring extraction from the end [duplicate]

I have this shell variable that gives me a string followed by the an HTTP return code. # echo $response good200 The script runs mostly on a BusyBox Shell and it has no Printf %q formatting. # echo $...
markfree's user avatar
  • 183
0 votes
3 answers
117 views

Efficient Data structure for searching substrings

I am trying to find a Data structure that saves strings and efficiently finds all strings that contain a given substring, e.g.: data = ["abc", "ccc", "akro", "muhaca&...
Ondrej NOHAVA's user avatar
1 vote
0 answers
35 views

What exactly lea call does with SI register and a variable in data segment?

The problem is checking whether a substring exists in a string input by user. As I understand, in main proc, the program calls lea si, inputstring which means SI points the inputstring in data ...
Dương Nguyễn's user avatar
0 votes
2 answers
45 views

Extracting/classifying quantitative information from character variable

I have a data.frame of the following type id text_information 1 Increase from 10.81% to 60.1% 2 Purchase 100.00 % 3 Increase from 5.9% to 45.48% 4 Purchase 99.0% I would like to process the ...
Enrico's user avatar
  • 77
-1 votes
1 answer
32 views

Unable to download CSV file from web URL with runtime using python

I have a need to download CSV file programmatically using python, from public healthcare website: link and write it to X folder. Here is my sample code: import json import urllib.request import ...
santosh kumar's user avatar
2 votes
1 answer
164 views

Is there any possible way to remove the 1st character of a String using O(1) time complexity in C++?

Suppose a String str = "Shajib"; I want to remove the first character 'S' from "Shajib". After removing str = "hajib". I want to perform this task in O(1) Time complexity ...
Md Shajib's user avatar
-1 votes
3 answers
77 views

Split string based on delimiter into specific substrings in python stored in multiple columns

I would like to split this string A->B->C->D->E->F into substrings as A->B,B->C,C->D,D->E,E->F. I tried using split and the delimiter as '->' but that doesn't give the ...
Nivs's user avatar
  • 1
0 votes
1 answer
53 views

Can you replace a substring from a regex match?

I am trying to find datatime stamps that have an incorrect timezone due to Daylight Savings Time (starting or ending). If the timezone is incorrect, I want to replace it with the correct timezone for ...
jdelgado1025's user avatar
0 votes
1 answer
46 views

Check Groovy string if it matches dynamically changing substring

Here I have following Groovy-example looking for a match (product value) from the example text below. def text = "This is my example text and it contains CD-12. Text continues after that." ...
jm90's user avatar
  • 141
0 votes
1 answer
56 views

Lookup every character in string and replace with character from another string

I have a table with two string type columns named IL and CL. I have to compare both the strings character by character and wherever there is a question mark in column CL string, I have to replace it ...
Truecolor's user avatar
  • 459
0 votes
1 answer
48 views

How to make pattern matching efficient for large text datasets

I'm currently working on a project that involves processing large volumes of textual data for natural language processing tasks. One critical aspect of my pipeline involves string matching, where I ...
melvio's user avatar
  • 976
0 votes
0 answers
62 views

SQL - Select only records where field contains either a given string explicitly OR or a range of strings within which given string falls

My data is set up as follows: MyDataFormat This is just a sample. There are hundreds of rows. This is for costing options (optional features) on a boat. My data above is a small sample of what we call ...
Jac's user avatar
  • 3
1 vote
1 answer
92 views

Word Count in C

I have a word count program in C that excludes special characters and number digits: int main(){ char str[100]; int i, j = 0; int len; char choice; do { printf("...
Roshina De Jesus's user avatar
0 votes
1 answer
55 views

Dynamic starting position in substring and dynamic length

I have code that for the most part is working as intended. However, it is returning one character too many at the end. I tried adding -1 and I get an out of bounds error. What am I doing wrong? SELECT ...
Joe's user avatar
  • 1

1
2 3 4 5
194