100 questions
0
votes
2
answers
40
views
PostgreSQL - Extract Value Between First Set of Parenthesis
Consider a string like Ana (16) and Brian (14) are my children.
How to get the value of the first parenthesis? ('16' in this case.)
I tried with substring('Ana (16) and Brian (14) are my children.' ...
-1
votes
1
answer
315
views
"AttributeError" -Why am I getting this error while trying to slice the last word of every line in a file in Python [closed]
AttributeError: 'str' object has no attribute 'slice'
I'm trying to print the last word if every line in a file but while slicing the last word of each line (each line in file is a string) I'm getting ...
1
vote
4
answers
93
views
Intersect a vector with a dataframe column that has multiple values in tidyverse
Suppose I have these variables in R:
vals <- c("b", "c")
foo <- data.frame(x=c("a|b", "b|c", "c|d", "e|f|g"))
I'd like another column ...
-1
votes
1
answer
39
views
Filtering and searching for strings by array_filter() function [duplicate]
I have a list of people's names and ages. Through function array_filter(), I can filter people who are over 40 years old, which returns the correct answer
But if I want to put a filter for the names ...
0
votes
1
answer
196
views
Find the records matching a string in tableau
I need to find the records that matches a string. I am using 'contains' function but it's not fetching me any results.
Any idea on how can I get the records matching a string.
If contains([Description]...
-3
votes
1
answer
158
views
Flat File to SQL server
I want to read data from a TXT/FLAT file and arrange the data using the first column contents as column names and the data after the semi colon as records .
SAMPLE DATA
{1:F01SBZAZAJJXXXX9999999999}{2:...
0
votes
1
answer
98
views
How to show the first 13 cards [closed]
I am trying 2 different codes on how to print the first 13 cards but i can't seem to know how.
1.
I need to print only the first 13 cards here but idk how to.
2.
This another code, I am confused on ...
-1
votes
1
answer
119
views
how to highlight the data I need in qlik sense
I have address data. The address data is separated by commas and I need to display the city corresponding to this address in the next column on the sheet. The city itself is indicated in the address. ...
-2
votes
1
answer
100
views
If input is: Jane Silly Doe Output is: Doe, J.S. If input is: Julia Clark Output is: Clark, J. Issue: I can make it run for either or but not both
If input is: Jane Silly Doe Output is: Doe, J.S.
If input is: Julia Clark Output is: Clark, J. Issue:
I can make it run for either or but not both
This only works for input Jane Silly Doe but not for ...
0
votes
0
answers
62
views
How to detect unicode character while file write operation
I copied and pasted the content into my text area and stored it in the database then I found Unicode characters as shown in the attached image in my database. How can I detect or replace them while ...
1
vote
1
answer
477
views
Kotlin String.split().filterIndexed() is returning empty list with size 1
fun main() {
val delDetails = "2-hello,3-world,4-why,5-is,6-it,7-like,8-this"
val delDetailEmpty = ""
val delPositions = delDetailEmpty.split("-",",")....
1
vote
2
answers
48
views
Converting characters to ciphered ASCII values
I want to take a word from a user and convert it into the separate characters' ASCII values, putting them in a list and seperating them by a hyphen. It then adds the user input for 'number' to each ...
0
votes
1
answer
2k
views
MS Access: "LEFT", "MID", "REPLACE", etc. functions lead to compile error
I've inherited a MS Access database which I should batch-update some data on. Thus, I've created a new query and as a first test tried to get some filtered record list - without success. Access ...
2
votes
1
answer
976
views
In MySQL 8.x the string function FROM_BASE64(str) returns result in hexadecimal form instead of a string
I have the following queries -
SELECT "Abc" AS result;
+--------+
| result |
+--------+
| Abc |
+--------+
SELECT TO_BASE64("Abc") AS result;
+--------+
| result |
+--------+
| ...
1
vote
2
answers
264
views
MySQL CHAR_LENGTH(str) sometimes produces different outputs for the same String literal when used with different character set introducers
This is weird. As per MySQL developer website -
MySQL CHAR_LENGTH(str)
Returns the length of the string str, measured in characters. A multibyte character counts as a single character. This means ...
0
votes
1
answer
170
views
Run Postgres string function on column created in same query
Using Postgres 11, how can I execute a series of string functions in the same query, where subsequent string function calls execute against the results of previously executed string functions?
My ...
2
votes
0
answers
279
views
Pig Latin Implementation in C
I'm trying to implement question 8.13 from C How to program, which is simply shifting left from the second char of the string and concat the first char of the string with "ay". For example:
...
-3
votes
1
answer
3k
views
Windows Batch - delete last characters from variable [closed]
I need to delete the last 3 characters from a variable in Windows batch
set string=abcdefghij
I need the following output:
abcdefg
I can delete the first 3 characters from the variable using this:
...
-1
votes
1
answer
129
views
How can I check if a Substring is a quotation
I want to make a if where it checks if a Substring is a ". Like here:
char comma = '"'
if(String.Substring(6, 1) == comma)
But this doesnt doesn't work and it gives me this error
Error ...
0
votes
1
answer
317
views
I need to get a string Array with single lines, which should be extraced from a big text with paragraphs
I got an idea that i wanted to make today but ran into the problem that i have a string variable with paragraph, but i need an Array of single lines. So I tried to do this with the String.Substring ...
0
votes
0
answers
155
views
Expose class functions to a function created using a string in JavaScript?
I need to run bunch of scripts saved in text. I need to convert them to JavaScript during runtime and it may have some calls to some functions within that class to get some data, like shown below. ...
-1
votes
3
answers
132
views
Runtime error in functions of python (list , string confusion in practice problem)
I have been trying to solve a particular question in my own amateur way from the Python 3 Bootcamp on Udemy. So far, there is an error, I guess, in the append() line of my python code. Here I have ...
-2
votes
3
answers
678
views
why is charAt(index)-1 function returning wrong output
String s = "1234";
for(int i=0;i<s.length();i++)
{
System.out.println(s.charAt(i));
System.out.println(s.charAt(i)-1);
}
In the above line of code , for the ...
0
votes
3
answers
100
views
c++ beginner, string.replace, code compiles but terminates - how do you replace numbers with another character?
In my code, I am trying to prompt the user to input their name, social security number, userID, and password, while outputting the social security number in "xxx-xx-xxx" format, essentially ...
2
votes
2
answers
28k
views
contains function for String in presto Athena
I have a table with ORC Serde in Athena. The table contains a string column named greeting_message. It can contain null values as well. I want to find how many rows in the table have a particular text ...
2
votes
5
answers
1k
views
How to remove delimited sections from text in PostgreSQL?
I want to eliminate some text pattern from a string, my string has a pipe delimiter, and the parameters do not always follow each other.
This is my string
TType=SEND|Status=OK|URL=min://j?_a=3&ver=...
-1
votes
2
answers
500
views
There is a find function....Is there an "opposite of find" function?
I want to know if you can find a letter by entering the position of it so it gives you the letter back.
In other words, I want a function that is the opposite of the find function?
P.S. if myString is ...
0
votes
0
answers
56
views
How can I do pattern matching for the below text using c#?
String text = "time : 11/22/2019 10:22:22 AM Message: db connection failed. Catergory: debug Priority: 2 EventId: 5 process Id: 12 process name: exe.win32"
How can I do the pattern matching ...
0
votes
5
answers
1k
views
String index out of range on space bar character
For example the name Donald trump (12 character) brings up the error string index out of range 7 (where the space is found) even though the name Donald trump is longer.
package test;
import javax....
2
votes
1
answer
2k
views
Can JavaScript String Function charAt() look for multiple characters?
How can I make my string.charAt() look for multiple characters at once? I'm looking to reduce the lines of code I have in my program, just wondering how I can fit multiple characters into one line.
...
1
vote
2
answers
989
views
SELECT only a specific set of characters (PostgreSQL)
I have a table with a specific set of characters containing the value, it's decimal and hexadecimal equivalents.
/-------------------------\
|value|decimal|hexadecimal|
|-------------------------|
| ...
0
votes
2
answers
2k
views
How to format a string value in MySQL?
Say there is a varchar column account_id all of them are 10 integer like 1234567890.
How can I format a value like 1234567890 to 123-456-7890 in mysql?
1234567890 => 123-456-7890
2
votes
1
answer
3k
views
String Aggregtion to create pivot columns in Big Query
I am trying to implement this exact solution linked below, but it seems GROUP_CONCAT_UNQUOTED is no longer a valid BQ function. Is there a solution to this that works in 2020?
p.s. I would have just ...
0
votes
3
answers
140
views
How to select from text list randomly?
I'm trying to build SQL function that I can use as a default value for a column. The function is about selecting an avatar image path randomly if the user didn't assign an image.
I have tried to but ...
-2
votes
2
answers
7k
views
Why identifier 'strlen' is undefined?
I am writing a program in C++. When I use the strlen function, it is underlined by a red line. Although the project is built without errors. This is how I use this function. (By the way, strcpy is ...
1
vote
0
answers
2k
views
How to find out the last rebooting time of the current server in SQL Server?
Since I already know how to get the CPU speed of the current server in SQL Server and I can find out the last time SQL Server service started and the total RAM memory on the current server
Now I ...
0
votes
1
answer
227
views
contains function in Xpath
I am using java to process Xpath for my project. I have and XMl similar to this
'''
<Tag1>
<Tag2>
<Name>ABC\Test</Name>
<value>10</value>
</...
0
votes
3
answers
64
views
Converting rows into more columns
i have a table with 4 columns ID,ROL_NUM,NAME,DEPT and having records as below :
ID ROL_NUM NAME DEPT
1 1 Rajasekar CSE
1 1 Bala ...
0
votes
2
answers
969
views
How to use strset() in linux using c language
I can’t use strset function in C. I'm using Linux, and I already imported string.h but it still does not work. I think Windows and Linux have different keywords, but I can’t find a fix online; they’...
-1
votes
2
answers
33
views
I need to get a portion from a string between two phrase, regex solutions would be great
I have string from which I need to get sub-string between a start and end phrases. Below is my string and start and end phrase.
MY STRING
Consolation Prize- Rs. 8,000/- NN 189822 NO 189822 NP ...
3
votes
1
answer
10k
views
Delete internal table lines where field contains the "+"?
I want to delete entries from an internal table, which has not a "+" in one column. Now, if I want to delete it like this:
DELETE internal_table where field1 <> '+'.
it doesn't work. This ...
0
votes
0
answers
52
views
Do php string functions assume automatic casting?
I´m dealing with Sabre/vobject. To read property values it is necessary to do a casting:
echo (string)$vcard->FN;
I forgot that a few times and observed that for example:
$number = str_replace("\...
0
votes
2
answers
192
views
CONCAT return null [duplicate]
I am trying to get three columns as a string but for some reason I only get NULL.
this is the code:
SELECT CONCAT(name, ' ', city, ' ', country) FROM places
the table places contains the three ...
0
votes
2
answers
2k
views
SQL Server: how can I combine the CHARINDEX, LEFT, and RIGHT functions into one expression?
I have the following SQL expressions, which do exactly what I need them to:
DECLARE @ServerName NVARCHAR(20)
SET @ServerName = RIGHT(@@SERVERNAME, LEN( @@SERVERNAME) - CHARINDEX('-', @@SERVERNAME))
...
2
votes
1
answer
168
views
What is the limit (in terms of bytes / number of args) to the FIELD() function in MySQL?
I'm thinking about using https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_field, but it doesn't say anything about any limits in terms of how many values it can support.
Does ...
-2
votes
2
answers
268
views
unable to start activity:StringIndexOutOfBoundsException: String index out of range: -2
I am retriving data from table and display it in textview , i have break the string using breakString() method but in last two data that are starcast and director , its showing ...
0
votes
0
answers
50
views
Is there a vb.net method similar to the old basic field function
I have a string of numbers separated by spaces. I want to add each number to an array. The string of numbers is in a textbox text property.
The syntax for the old field function is:
FIELD (string, ...
0
votes
1
answer
849
views
Trying to Split a String Into Parts by SQL Query
Please Excuse me if this is Simple... I am new to SQL..I am need to Run this Custom SQL Query to get data from Microsoft SQL Server. Here is this field
TitleName
abc_34235
abcd_2_56543
xyz_4532
I ...
1
vote
1
answer
940
views
database: portable way to compare two version number?
What is a cross platform syntax to compare two version numbers? A version has two parts: major version and minor version, both are integer.
To compare two versions, first compare their major versions....
1
vote
1
answer
1k
views
RIGHT() function in Postgres is not right
I'm reviewing the Postgres RIGHT() function documentation, right..
For the documentation example:
SELECT RIGHT('XYZ', 2);
I was expecting the right response as per the documentation viz;
right
----...