24,568 questions
Best practices
0
votes
7
replies
92
views
SPLIT without implicit conversion
I am experiencing problems with this section of my formula
=LET(
args; MAP(SPLIT("11/11"&CHAR(10)&CHAR(10)&"1"
; CHAR(10)&CHAR(10)); LAMBDA(v; TO_TEXT(v)))...
0
votes
2
answers
181
views
Split a string into an array but ignoring blank lines [duplicate]
I'm trying to get a relatively simple regex working the way I want it to. I'm trying to split a string into an array but ignoring blank lines.
Here's what I've got so far
const regExp = /\s*(?:\n|$)\s*...
0
votes
4
answers
198
views
Split function with if statement to define string value (excel vba)
My vba excel code is using split funtion from a combo box value. It takes an ID (alias=GG) which is a value right of the 6th hyphen.
GG = Split(Sheet1.ComboBox1.Value, "-")(6)
example return ...
-3
votes
1
answer
205
views
Splitting file content using C++20 ranges [closed]
I'm trying to iterate through a text file's lines using ranges:
auto iter_lines(std::ifstream& file)
{
auto lines = std::ranges::istream_view<char>(file) |
std::views::lazy_split(...
1
vote
1
answer
168
views
`-split` of an empty string results in an array with one element which is an empty string
Calling -split on an empty string results in an array with one element which is an empty string. I expect it to return a zero-length array or a $Null which is not an array.
What am I doing wrong?
# ...
0
votes
0
answers
117
views
Splitting Spool by pages and download in ABAP
My customer has the request, that a spool with for example 10 Pages need to be downloaded by separated pages.
Let´s say, that the Spool has 10 pages and at every two pages I need to split the Spool ...
9
votes
1
answer
152
views
How to remove character differences from multiple strings [duplicate]
Let's say I have a bunch of product strings that could vary slightly in format, e.g.:
Super red Megaman T-shirt
Super Megaman blue T-shirt
Super black Megaman T-shirt
Super Megaman T-shirt - ...
-4
votes
3
answers
132
views
Get string between two delimiters
I have a string like
s = "<foo> <bar ... <baz.ind>
and I need only the contents of the last <...>. In the above case it should be only baz.ind.
The below code prints not ...
2
votes
3
answers
80
views
PowerShell Split String After X Segments
Trying to get a substring out of a larger string from an Azure Subnet. The vnet resource id is identical to the subnet resource id minus the last 2 segments. User inputs the resource id of the subnet, ...
0
votes
0
answers
34
views
Why does Python use different syntax for split() and join()? [duplicate]
In Python, when we use split(), the syntax looks like this:
list_result = string.split(separator)
But when we use join(), it's written like this:
string_result = separator.join(list_of_strings)
Why is ...
15
votes
7
answers
1k
views
Split all columns in half by character position
My dataframe has a bunch of columns, each with six characters. Like this:
df = data.frame("A" = c("001000","101010","131313"),"B" = c("121212&...
1
vote
0
answers
54
views
Iteratively name elements in an array in Pyspark
In Pyspark I create an array from a string with split function.
For example:
old_df.long_string = "this is ** a very long ** string with a lot ** of words in it"
new_df.withColumn("...
0
votes
0
answers
43
views
Can I use the String.Split() method overloads while splitting at white-space characters without having to specify the white-space characters? [duplicate]
I'm trying to split a string into an array of strings. I want to split at every at white-space character and also use StringSplitOptions to remove and trim the empty entries.
Is it somehow possible to ...
1
vote
1
answer
176
views
I Split a string into an array. The first element is blank/null/empty if the String starts with "BLAK"
I've been coding VBA for 20 years and this has me stumped. I'm testing the code below. If I step through it:
Sub TestSplitting_1()
Dim sColors As String
Dim aColors() As String
Dim sColor As Variant
...
0
votes
1
answer
58
views
Can't set value of a split list in Python
I'm having trouble setting a list at a certain index to a specified value. For example:
healths[index].split(",")[anotherIndex] = 0
This code runs but doesn't change the value. The reason I'...
4
votes
6
answers
176
views
How to split a string into chunks of 2, but make the last chunk 3 if it would be 1
I have a series of strings of numbers of different lengths that I need to split into chunks of 2 characters. The last chunk should be 3 characters long, if it would be 1 character long.
For example, ...
3
votes
2
answers
55
views
Stratified sample split
I am working with data from 174 subjects, stored in a dataframe (df_behavioral) where one row represents one subject. Some subjects are related to one another, as indicated by a variable called '...
1
vote
1
answer
119
views
How to filter elements from an array made by spliting a string? [duplicate]
When I do ($env:path).split(";"), there are many elements containing the string bin. I want to have a list of them. I try:
($env:path).split(";") | Where-Object {$_ -contains "...
0
votes
0
answers
39
views
Python Folders Splitter to Files Splitter
Based on this great piece of code: GitHub Splitter.py
I would like to work on files and not on folders.
The code is so short:
#gadgetmiser's idempotent splitter
import os
from shutil import move
wd =...
2
votes
6
answers
148
views
Create nested lists based on split of characters
I have a list made by strings, correctly cleaned (split(',') can be safely used), and correctly sorted depending on numbers. As a small example:
l = ['C1', 'C1,C2', 'C2,C3', 'C3,C4', 'C4', 'C5', 'C5,...
3
votes
5
answers
127
views
Splitting one column to three columns for uneven characters in r
I have tried to split a single column to three columns. But I failed.
I have the following data set
> dat
name
Jhon Austin B 100kg
Mick Gray C 110kg
Tom Jef A 30kg
First I tried to extract ...
-2
votes
2
answers
75
views
How to split string to substrings wrapped by brackets? [closed]
I have a string like this
[abc][def]
I've implemented following code to parse it:
val matches: MutableList<String> = mutableListOf()
val str = "[abc][def]"
val matcher = Pattern....
-1
votes
1
answer
59
views
How do I split an OBJ file into three parts using blender 2.90
I have an object that I want to split into 3 segments and save into individual obj files. The object is placed in the center and the x-y plane. I want to cut them along the y-axis. I have attached a ...
0
votes
3
answers
84
views
Python split() function :: Need to split "int_32\n' " so that I get int_32 alone [duplicate]
Need to split "int_32\n' " so that I get int_32 alone.
I tried
x = "int_32\n' "
x.split("\n")
I also tried
x = "int_32\n' "
x.splitlines()
Both do not yield ...
0
votes
2
answers
71
views
How to split a dataset in train, validation and test based on the value of another column
Given a dataset of the form:
date user f1 f2 rank rank_group counts
0 09/09/2021 USER100 59.0 3599.9 1 1.0 3
1 10/09/2021 USER100 75.29 80790....