1,008 questions
2
votes
2
answers
235
views
How do I convert a hyphenated phone number to words (with 0 as "oh")?
I'm working on a text to speech project, and I don't know how to handle US phone numbers. All phone numbers are in this format: 123-456-7890
I would like it to be converted to this: one two three, ...
4
votes
5
answers
202
views
Check if a string starts with a substring from an array of substrings and return that substring
I have an array with all German telephone area codes that is 5266 items long and looks like this:
$area_codes = array(
'015019',
'015020',
'01511',
'01512',
'01514',
'01515',
...
0
votes
2
answers
76
views
How to parse names and percents
Import table
create table import
(
articleNumber c(20) primary key,
material char(70)
);
insert into import
values ('TEST', 'Main fabric: 50% Organic Cotton, 49% Cotton, 1% Elastane' )
...
0
votes
1
answer
105
views
String parsing in DataStage
I have a problem with a DataStage Parallel Job that doesn't parse strings properly.
I have a csv file, with two columns containing json-shaped strings. The job reads it with a Sequential File stage, ...
0
votes
1
answer
140
views
How to split OBX segments of variable length separated by "`" and map to individual JSON fields using Javascript
I am mapping HL7 messages into JSON and came a across a scenario that I am unsure of.
I need to convert OBX segments, like the below:
OBX|1|CE|2643^MED LIST&PRESCRIBED MEDICATIONS^||VYVANSE`...
-1
votes
2
answers
414
views
SQL to parse very long string into many columns
How to use base SQL to parse a very, very long string into many columns by a delimiter?
I’ve been through a few posts (here for example, and here or here) on parsing into separate columns, rows, et ...
-3
votes
1
answer
85
views
How do I fix the error while trying to use datetime.strptime to convert a string to a datetime object? [closed]
date_str = "2024-04-19 15:30:00"
datetime_obj = datetime.strptime(date_str, "%Y-%m-%d %H:%M:%S")
I attempted to convert a string to a datetime object using the datetime.strptime() ...
0
votes
1
answer
44
views
Is there a way to remove leading and trailing substrings without custom code?
Can you remove leading-and-lagging characters-and-substrings from a string without using RegEx-and/or-Custom-Code?
For example, I want to remove leading https:// and lagging / (backslashes).
I can ...
0
votes
0
answers
89
views
Error Parsing Episode Number from String "One Piece Film: Z - Filme" in Go
I am developing a Go application that interacts with an anime website to download and play episodes. The application should handle both regular series with numbered episodes and movies/OVAs that do ...
1
vote
1
answer
177
views
Detect data in txt files, string parse and output as csv file
this is my code. I am working on use code detected a bunch of text files in a folder and then string parse the data output as csv files. Could you please give me some hint on how to do this? I am hard ...
0
votes
1
answer
441
views
Get UUID from string in mssql (sql-server)
I get some field in mssql which contain uuid like:
root://Item/Item//4296d6c9-3cc4-3d21-af4f-0cd4cdfbf31b/15/11
And I need to retrieve UUID from such string. It can change, and be like
root://Item/...
1
vote
2
answers
506
views
How to fill an HTML closing tag with its corresponding opening tag?
To make things clearer and easier, I have a method which has 1 changing parameter. The imported string contains text and text formatting options, the method should recognize the closing tags (always &...
1
vote
2
answers
236
views
Parse string to integer in arbitrary base/radix
In other languages besides Perl, if I want to parse a string representing a number in a weird, non-standard base (not necessarily the normal binary (2), octal (8), decimal (10), or hexadecimal (16) ...
1
vote
0
answers
61
views
Is there a `std::format` counterpart for string parsing? [duplicate]
std::format serves me well as a replacement of C-style std::sprintf. I'm not yet aware of any similar counterpart for string parsing. Is there a similar thing proposed for C++? I want to use it in ...
0
votes
0
answers
322
views
FastUtil - operation on Set fails with Long type
Minimum reproducible example below, with the dependency:
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>8.5.12&...
0
votes
1
answer
906
views
How to Parse a String to Logical Condition in C#
I am looking for a nuget package which could help me to parse a string to a logical condition in C#. I have a configuration file in json, where users can configure the logic as follows.
"...
-3
votes
1
answer
463
views
The project has static values but don't work FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) [closed]
I have a core project that stores static data, I use it in the data preoctc and I get this error
System.TypeInitializationException: 'The type initializer for 'ERP.Core.Constants.CoreDefaultValues' ...
0
votes
2
answers
115
views
What are ways of comparing number values where some come in the form of e.g. '32k' or '2.5m'
Is there a standard way in JavaScript to easily compare two numbers where one or both can be in the form of e.g. '32k'. For example:
'32k' > 310
'2.5k' > 450
300 > 200
'2.5m' > '2.5k'
So ...
0
votes
2
answers
808
views
Yaml - how to replace key value using sed?
I have a yaml config, and I want to replace one of the fields with a new value?
Here is an example of the yaml config:
application: "app_name"
pipeline: "app-pipeline"
parameters:
...
0
votes
1
answer
291
views
Extracting numbers using Regex in Matlab
I would like to extract integers from strings from a cell array in Matlab. Each string contains 1 or 2 integers formatted as shown below. Each number can be one or two digits. I would like to convert ...
0
votes
1
answer
87
views
Get the biginteger number from String in java
I'm trying to parse messages I receive using AT+CMGL command.
My main interest is to get the 15 digit number from the message and store it in a table.
Here's an example of the data the I receive :
+...
-1
votes
1
answer
55
views
How i print specific information on Bash
#!/bin/bash
echo "Digite o IP"
read ip
iod= snmpwalk -v2c -c public "$ip":161 .1.3.6.1.2.1.1.5
echo "$iod"
OUTPUT
iso.3.6.1.2.1.1.5.0 = STRING: "Name"
I ...
0
votes
1
answer
68
views
Pattern based string parsing
I have below string as input
string input = "{A.0a,100,0002_VL}{=}{A.0a,0400,0001_VL}{+}{A.0a,0410,0002_VL}{+}{A.0a,0420,0003_VL}"
I want below output as string array
string[] output
...
0
votes
5
answers
1k
views
Splitting string in 2 parts by removing substring in golang
I'm trying to parse strings that look something like this:
abc***********xyz
into a slice (or 2 variables) of "abc" and "xyz", removing all the asterisks.
The number of * can be ...
0
votes
1
answer
120
views
Replace a string value from all the lines of all the text files in a directory
I have a several files with contents as such.
file01.txt
$ cat file01.txt
0 0.499594 0.154888 0.094968 0.156027
4 0.114448 0.101337 0.113636 0.035701
1 0.173701 0.154888 0.235390 0.068758
3 0.397727 0....
0
votes
0
answers
76
views
C# is value part of Enum [duplicate]
I found an edge case for enum values and want to know whether there is a solution for that problem in .net5
I´ve got the following enum:
public enum SomeEnum : ushort
{
FirstValue = 0x9D80,
...
1
vote
1
answer
68
views
Unwanted backslash added to string when join a list of strings
I have the following string:
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -...
1
vote
1
answer
174
views
A function the provides the [TAB] key latex functionality in Julia REPL
In the Julia REPL, if I want to type the α character, what I would do is: \alpha[TAB] which returns the Greek letter, what I would like to do/know if there is a way to emulate this behavior via a ...
0
votes
3
answers
142
views
Any suggestions to improve Python string parsing
I'm running Python 3.6.8. I need to sum values that appear in a log file. The line may contain 1 to 14 {index,value} pairs; a typical line for 8 values is in the code below(variable called 'log_line')....
1
vote
2
answers
496
views
How to replace the overridden methods with a Recursive implementation
I want to use recursion in order to collapse the overridden add() methods in the code and allow the user to provide any number of terms.
I've made a couple of changes to my code, but I'm not getting ...
0
votes
1
answer
500
views
Parse A Text In A Text File With Python
I use the '/' special character to split each word in the text file. The code output is as follows:
Mariam / AI / DS / ML
Steeve / DM / CO / DBMS / ML
Peter / DS / CO / MDS / ML
Stella / AI / DS ...
0
votes
2
answers
120
views
split column value of a table and skip some words
Hil All,
I have a table , count is about 200M. It has a column which contains data separated by '~'. I want to parse it.
e.g:
Column1
A~B~C~D~E~F
Result :
Column_new1
A~C~E
I just want to skip 2,4,6,...
0
votes
1
answer
876
views
What's the best way to parse dynamic JSON data
Imagine a method accepting 2 string arguments:
public int Method(string expression, string variables) { ... }
"expression" is expected to be a math. expression (e.g. "1 + 2") that ...
1
vote
1
answer
2k
views
Parsing the payload of the AT commands from the full response string
I want to parse the actual payload from the output of AT commands.
For instance: in the example below, I'd want to read only "2021/11/16,11:12:14-32,0"
AT+QLTS=1 // ...
1
vote
3
answers
84
views
Group values of a flat array based on their leading substring
What I want the code below to do is loop through the $check_query array, find all the values that contain the word standard and push them into an array. I'd like to also do this for the strings that ...
0
votes
3
answers
3k
views
Parse postgres URL
I'm trying to parse postgres db credentials, the format is as follows:
postgres://usernname:password@hostaddress:port/databasename
I'm calling a method which returns these credentials in the form of ...
1
vote
3
answers
3k
views
How to split a string with comma separated pairs of colon separated keys and values and pass it into a javascript object?
Currently using str.split(',') on a string and passing it into an array (also simultaneously removing next lines and " from the string). The string looks like this:
let array = [];
const string =...
-1
votes
1
answer
180
views
Calculate of prices in within an array of strings Array<String>
I have an array that describes a list of auto parts (Swift/IOS,array already in such structure arrived from other source.):
let parts = [
"Wheel = 230$",
"Door = 200$",
...
-1
votes
1
answer
266
views
How to remove javascript from string using python and then parse remaining string to table?
I have this string that i scraped from an unversity website. I want to parse it into a table where each row would consist of strings before and after a colon,":".
This is the string.
'...
4
votes
1
answer
4k
views
In CMake, how do I check whether a string contains an integral number?
I have a string in CMake which I got somehow, in a variable MYVAR. I want to check whether that string is an integral number - possibly with whitespace. I have an ugly way to do it:
string(REGEX MATCH ...
0
votes
1
answer
150
views
What will I have to write in my program so that it would only accept commas in their proper location (i.e. cannot input 10,00.0 , 100,0.2334, etc)?
I am taking a summer course in computer science, and I get assigned two projects a week, so bear with me if I'm getting some terminology wrong.
This week, I was able to get the first one done, but not ...
0
votes
1
answer
2k
views
Parse address strings in R
I have address data in R in multiple address formats and would like to parse to at least significant address parts so I can use address to merge multiple datasets. However since address can be in ...
-1
votes
1
answer
144
views
Typescript dynamic interface from object values
I am creating args parser from a string.
I have interface for defining args names and default values
interface IargsDef {
name: string;
default?: string;
}
What I want is for intellisense(...
-1
votes
1
answer
771
views
How to measure the length of a string before a specific character [duplicate]
I'm calling an API which gives me the sunrise time of specific cities I request.
The issue is that when the sunrise is before 10 am I get it in the format, for example, '9:10 am'. This messes up my ...
1
vote
1
answer
2k
views
Parsing variable types from Strings in javaScript
I'm working on an html/js project in which I'm trying to pull two strings from my html script, send them over to js and parse them into their variable types in a way similar to typeof. For example, &...
1
vote
2
answers
775
views
Python extract paragraph in text file using regex
I am using Python 3.7 and I am trying to extract some paragraph from some text files using regex.
Here is a sample of the txt file content.
AREA: OMBEYI MARKET, ST. RITA RAMULA
DATE: Thursday 25.03....
0
votes
1
answer
1k
views
How do i pass multiple parameters from list in sqlalchemy filter statement
the user returns a string where is parse to apply the filter in sqlalchemy.
but the numbers of parameters are unknown.
eg:
def fun_name(user_id, value):
return db.query(table)
.filter(or_(...
-1
votes
1
answer
96
views
Parse string into 2d integer array in javascript
I need to parse this string
d = "1 3 2 1,1 1 2 4,1 1 2 5,1 1 2 6,1 7 2 1,1 8 2 1,1 9 2 1,1 1 3 4,1 1 3 5,1 1 3 6,1 7 3 1,1 1 3 8,1 1 3 9,1 5 4 1,1 6 4 1,1 7 4 1,1 1 4 8,1 1 4 9,1 6 5 1,1 7 5 1,1 ...
-1
votes
1
answer
163
views
How to convert String to int and call method on it? [duplicate]
I have tried to convert my String to an int but my code keeps crashing.
The code is as follows:
String age = getAge();
CalculateDaysSinceBirth((int) age);
But I get a NumberFormatException.
0
votes
4
answers
296
views
Printing of initials without "." as the last character
So I want to make a program in C which prints the initals of a name but facing one problem . My program should not print . as the last character, and I have tried this:
#include <stdio.h>
#...