24,497
questions
0
votes
3
answers
55
views
Separating a Dataframe Column by Multiple Delimiters Into New Columns Using Pandas
I have a table similar to the one below where I have a summary column with groups and an associated value separated by a colon where each separate group with its value is separated by a comma. (group1:...
-2
votes
0
answers
46
views
Index out of array range even do its below range? [duplicate]
Debugger says maxRows = 6 and j = 5
but it throws a System.IndexOutOfRangeException ?
I am trying to split a string into a twodimensional array.
after ';' -> next entry
after '#' -> next row
...
7
votes
1
answer
148
views
Split on regex (more than a character, maybe variable width) and keep the separator like GNU awk
In GNU awk, there is a four argument version of split that can optionally keep all the separators from the split in a second array. This is useful if you want to reconstruct a select subset of columns ...
0
votes
2
answers
78
views
How to split a column into two columns to separate two values in a cell when some cells don't contain two values to split using dplyr in R
Issue
I want to split a column named 'Date' in my data frame into two columns called 'Date' and 'Survey_Number'
The column 'Date' either contains one date '08/04/2012' or a date and survey number '24/...
1
vote
1
answer
33
views
How to split a string into only two parts (and not discard other parts)
Say that I have these data:
clear all
set obs 2
gen title = "dog - cat - horse" in 1
replace title = "chicken - frog - ladybug" in 2
tempfile data
save `data'
I can split these ...
-1
votes
3
answers
57
views
How to extract convert date in written text to numeric
I've a problem where I from a product description need to convert the months of the description to a billing period. Example description:
Transaction packages 2500 transactions / year included (JUNE-...
0
votes
0
answers
26
views
match random lengths of string using regex (preg_match) [duplicate]
i have need to split string, by regex:
split digits together
split letters together
[ each part should contain between 3-5 chars RANDOMLY ]
so if i have:
'...
1
vote
1
answer
28
views
Spilt dataframe colums and create new dataframe with Pyspark
I have pyspark dataframe with only one column having below data
Gourav,Joshi,"Sibley Grove,402,wmbley,London,United Kingdom",E1234,44982728930
Is there is any way to split this columns and ...
0
votes
1
answer
26
views
Fix csv line splitting
I have a csv file data like below with nearly 1 million records
sno, name, address, mobile
1, shekar, hyderabad, 651584651
2, naveen, ban
galore, 61353384
3, eeshwar, warangal, 65133133
What I want ...
-8
votes
1
answer
112
views
In C#: #13 is "\r", "\n", or "\r\n" [closed]
I have a «Requirements Specification» document detailing how to construct a text. #13 is part of the concatenation. What is it the meaning of #13? I know that you must use Environment.NewLine to ...
0
votes
3
answers
59
views
Weird behaviors around "." string manipulation in PowerShell
I'm using PowerShell 7.4.5.
First example: 'a.b' -split '.' does not give you a two-element array of a and b, but a four-element array of empty strings.
Another example is 'rodtipsqleastus2.database....
0
votes
2
answers
42
views
How to ignore double spaces in txt file (Powershell)
I have a powershell script to "convert" txt file into xlsx. The text in the txt file has a very specific structure so it can be worked with. It looks like this:
Student:: Doe John
Username:: ...
-1
votes
1
answer
53
views
Text is split depending on the order of specific delimiter [duplicate]
The code is supposed to split the string without removing the delimiters.
import re
operations = '8-8/84'
operations = re.split(r'([+,*,/,-])', operations)
Executing the code, operations ends up with ...
0
votes
1
answer
42
views
How can I split this filename to get the date only
How can I use VB.NET to split the below file names with one variable to extract the date portion of the filename?
I'm initially getting the filename from a path. Two examples:
Mozart - Cpt - 03 Aug ...
-3
votes
2
answers
779
views
Placeholders wrongly replaced with % char [closed]
I want to change placeholder in a string, separated by % char. For example, %test% should be replaced by SERVER (in the example here). Others cases would be like %name% changed by the user name.
One ...
0
votes
1
answer
27
views
Split and Arrange columns pandas
I have one raw column like this: enter image description here
variant_label
XL / White
Black/ S
White / S
L/ White
X/ Black
Black / XL
White / M
Black / M
Black / M
Black / L
XL / White
I want to ...
0
votes
1
answer
127
views
How to separate a specific part of the text from a text in golang
guys i want have input and split that one specific part of that
for example
input is : "bla bla bla (asd) bla bla bla"
output is: (asd)
and when found parentheses in my input get it and my ...
0
votes
1
answer
74
views
Split String in Pandas Series
Can I use the split() function to transfer this series:
s = pd.Series(['adh', 'bei', np.nan, 'cfj'])
To either one of those outputs:
s = pd.DataFrame({
'A': ['a', 'b', 'c'],
'B': ['d', 'e', '...
-2
votes
0
answers
55
views
How to split a string of numbers into an array of integers? [duplicate]
I have an string of numbers with spaces as below:
std::string str{"1 2 3 4 5"};
I'd like to convert it into an array of integers:
std::vector<int> str_int{1,2,3,4,5}
This is my code, I ...
-4
votes
2
answers
75
views
Split a string with multiple required delimiters
I have the following string
Text1:/nText/nText2:/nText/nText/nText3:/nText
I'm trying to split it into a dictionary where any line with a ":" is key and anything without that is in value.
...
2
votes
1
answer
89
views
Polars split column and get n-th (or last) element
I have the following code and output.
Code.
import polars as pl
df = pl.DataFrame({
'type': ['A', 'O', 'B', 'O'],
'id': ['CASH', 'ORB.A123', 'CHECK', 'OTC.BV32']
})
df.with_columns(sub_id=...
3
votes
2
answers
64
views
Is there an efficient way to sum over numpy splits
I would like to split array into chunks, sum the values in each chunk, and return the result as another array. The chunks can have different sizes. This can be naively done by using numpy split ...
-1
votes
1
answer
25
views
splitting a string into workable lists (Python)
I want to be able to turn a user input string into a string list and then modify that list as needed.For example sake I will be useing: (a+b)(b+a). where the final result is list[0]=a+b and list[1]=b+...
-2
votes
3
answers
96
views
Batch Script to split record by fixed length [closed]
I have an input text file with a single line having thousands of records one after another. I want to split them after length of 10 characters each.
**Input Record** -
====================== Begin of ...
0
votes
1
answer
51
views
Can I split excel cells word by word into rows where every cells contains only one word using Python?
i have an excel file with texts in a lot of cells and i want to split these texts word by word and organize into cells in one column by rows. Like every cell contains one word. it is because after i ...
-1
votes
2
answers
39
views
How do I convert an id that defaults to comma-separated string to an array of strings?
I am trying to pass data from Formidable Forms to Brevo with an API. Here is my code so far:
{ "updateEnabled": true,
"email": "[376]",
"emailBlacklisted&...
0
votes
0
answers
36
views
string_split SQL Server [duplicate]
I have a list of conditions, comma delimited, within a column and I'm trying to convert the list into rows within a SQL view, using string_split.
Unfortunately, the list of conditions within the ...
1
vote
2
answers
80
views
Split columns of a table into multiple columns
I'm trying to code a powershell script that can iterate through the whole table, find every column with multiple values (they're delimited either by ";" or "/") and split them. but ...
0
votes
1
answer
59
views
How do I get unique pairs based on shared values in two grouping variables?
I have used Florian's answer to this question to get the unique pairs separately for the one shared (grouping) variable. Can this be extended to the case where there are two grouping variables, and ...
0
votes
7
answers
182
views
Splitting and substitution by comma is not working in shell script
I have a string
z="job_name=market_scenario,channel=GOOGLE FACEBOOK INSTAGRAM,time_limit=60sec"
Now I want the data in the below format:
job_name=market_scenario
channel=GOOGLE,FACEBOOK,...
0
votes
0
answers
13
views
ArcGIS Pro SPLIT BY that also joins the data of the split feature to the target feature
Layers:
I have two features layers in ArcGIS Pro:
a zoning base feature layer that is the target layer
a zoning overlay feature layer that will be used to split the base layer
Goal: to essentially ...
0
votes
1
answer
64
views
split pandas datafram based on given row string
I have a text file with a data set of the form
Line 1
Line 2
!
1.01499999 0.504999995 6.19969398E-7 5.38933136E-7 1.35450875E-6
1.74000001 0.220000029 7.92876381E-6 4.1831604E-6 6.61433387E-6
2....
-4
votes
1
answer
83
views
Java String split by empty lines including empty lines at the end [closed]
I have seen many questions and answers online, but it seems that I cannot find the case that I have.
String s = "a\nb\n\nc\n\n\n\n";
String[] split = s.split("\\R");
//is the same ...
0
votes
1
answer
83
views
terra::split | R session aborts when splitting polygon fatal error
When trying to split a polygon R runs into a fatal error and aborts. This happens when using R Studio and R on itself. I wrote the code on an earlier version of R on a different machine (also a mac), ...
3
votes
2
answers
27
views
Split a string in JavaScript when last number arise
I want to split the string "111A1A.11111.SL.111FUND II GP_KY.zip" when last number is arise.
string="111A1A.11111.SL.111FUND II GP_KY.zip";
output="FUND II GP_KY.zip";
I ...
0
votes
2
answers
88
views
rust `split` split before the pattern match
I'm trying to split up a String retaining each pattern match but with the matched part retained as the beginning of the next sub-string rather than the terminator of the last.
Current implementation:
...
4
votes
3
answers
160
views
Word splitting bash parameter on whitespace respecting and retaining quotes
Given the bash parameter
foo='ab "cd" "e f" x="1 2" '
I wish to produce an array equivalent to
foo_transformed=( ab '"cd"' '"e f"' 'x="1 2&...
1
vote
1
answer
61
views
Pyspark SQL not splitting column
I was trying to split my column using pyspark sql based on the values that are stored in another column, but it doesn't seem to work for some special characters.
Here is my code:
df = spark....
-1
votes
1
answer
52
views
Split a video with ffmpeg, without reencoding, at timestamps given in a txt file
Let's say we have a video input.mp4, and a file split.csv containing:
start;end;name
00:00:27.132;00:07:42:422;"Part A.mp4"
00:07:48.400;00:17:17.921;"Part B.mp4"
(or I could ...
1
vote
1
answer
51
views
Splitting up a variable range of time into multiple cells
I need to split up a range of time from a variable input in excel, for example
Start
End
11:00:00
13:00:00
I would like to have the input split up in segments of 30 minute intervals (input is only ...
0
votes
1
answer
58
views
Parsing a string with text within it
I'm trying to read in and parse a CSV output file from PostgreSQL, but there are some oddities in the data. The data contains vehicle details. One problem is with old Land Rovers which have models ...
0
votes
1
answer
56
views
How can a number range and value be extracted from this complicated string using Python?
I have a complicated string that includes a kilometer range and a fee for users that fall into that range. Ideally, I would like to transform the string into something that I could use to easily ...
0
votes
1
answer
67
views
Split out numbers in a column
I'm trying to split out the two numbers in the cell into separate columns
I've tried "text to columns", using the delimitator "space" but it removes the second number in each of ...
-4
votes
1
answer
60
views
Python - Extract data from text
I have lots of files in a database and with a command I can retrieve information from a file, but the problem is that I get this very abstract result, for example
[File({'added_on': 1720455648, '...
0
votes
1
answer
75
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-...
0
votes
1
answer
103
views
Huggingface library not being able to replace separators in create_documents: "AttributeError: 'dict' object has no attribute 'replace'"
I'm a beginner in the chatbot developer world and currently building a rag code to create a context based chatbot, but I keep getting this error, I believe it happens when the text is being split, ...
0
votes
2
answers
112
views
Extract and process substring between varying numbers of delimiters in a variable length string
I have a table dates with a column SENTDATE where each row has a varying number of dates in it, separated by a semi colon (;). The dates are currently in the format YYYYMMDD - for example:
20240529;...
1
vote
2
answers
42
views
How can I split a string on whitespaces or quotes if they're present
Context: I have a list of keywords that sometimes consist of one word (e.g. poisson, normal, ...) and sometimes consist of two words, which are then within single quotes ('Two-way ANOVA', 'Generalized ...
0
votes
1
answer
26
views
text slitting in R
item<-c("A","B")
Type<-c("P400","1200C")
> test_df<-data.frame(item, Type)
> test_df
item Type
1 A P400
2 B 1200C
test_df<-test_df ...
0
votes
1
answer
40
views
column splitting /filtering in R and
I have the below sample data frame:
item<-c("A","B")
Type<-c("403P","1200C")
test_df<-data.frame(item, Type)
> test_df
item Type
1 A 403P
2 ...