Questions tagged [character-trimming]
39 questions
1
vote
1 answer
Why is SQL code to get the extension adding extra spaces?
I followed the example in this answer Get extension of a file using SQL? to extract the extension from a list of files in a folder. It's working great, but is throwing in 6 extra spaces. I've tried adding an rtrim, but that hasn't helped, unless I'm…

Josh McGee
- 75
- 8
0
votes
2 answers
Receiving ParseExpression while trying to use rtrim with expr
I want to trim extra characters from a given column "name". For that, I am using expr function within which I am passing a SQL expression to trim extra characters.
from pyspark.sql import Row
from pyspark.sql.functions import expr
data = [
…

aws_sangram
- 59
- 6
0
votes
0 answers
POSTGRESQL "select rtrim(*) from sample_table;" doesn't work. Any ideas on how I CAN make it work?
select rtrim(*)
from sample_table
;
ERROR: function rtrim() does not exist;
Error while executing the query
Trying to right-trim all fields in a "select *". My coding "mentor" said it can't be done... help me prove him wrong...

William King
- 11
- 2
0
votes
0 answers
Why does the final sequence in my FASTA file not get trimmed in my code (biopython/python)
I'm trying to include a trimming step in my script to remove 20bp of sequence from the 3' end of my sequence if the sequence is >290bp long. Here is the part of the script:
from Bio import SeqIO
fasta1 = SeqIO.parse(path+'\FolderMulti.fasta',…

Jess
- 13
- 1
- 5
0
votes
1 answer
Need to remove spaces in between days and add comma using sql
I would like to remove spaces and add commas in between the data using SQL. Like if I have column with the data ' mon tue wed thu ' I need it to be like 'mon,tue,wed,thu'
Can someone help me with this.

Dug
- 1
0
votes
1 answer
Deduct one character until a row is returned, and trim spaces when returning values [Java/SQL]
i need to search string in SQL using Java, expectation is something like this:
input: 123456
data in SQL to be fetched: 123777
result is: ' AB C '
result should be: 'ABC'
iteration will be like:
select col1, col2, col3 from table where input like…

dcdum2018
- 93
- 1
- 9
0
votes
1 answer
Why rtrim() trims character 'p' in PHP?
I want to remove , from the below string. Here what I have tried
$str = "3gp, ";
echo rtrim($str,', ');
But the output is 3g
It always trims the character p.
I'm using PHP 7.1. Any idea on what's happening?
Edit: it trims 'n', 'b',…

Michel
- 1,085
- 13
- 24
0
votes
1 answer
Trim Powershell OutPut
Requirement is to trim the Output. Retain only the output quoted within double quotes from Name and remove/avoid the earlier lines/characters
From:
$R.Output = \\GBVServer1\root\cimv2:Win32_Group.Domain="Contoso",Name="Domain Users"
$R.Output =…

HGB 85
- 3
- 2
0
votes
1 answer
Show and hide text feature with one issue. How to remove the initial "show less" element?
The code functions the way that it should.
I am having a hard time figuring out how to initially hide the "show less" button from the display.
All i'm doing here is grabbing the first paragraph and hiding the rest to show once the continue reading…

Nick0989
- 459
- 5
- 15
0
votes
2 answers
Trim the total character value of title and excerpt combined
I would like to trim the combined added character value of a post title and excerpt.
Currently I can do both independently - the excerpt through the theme settings and the Post title though JS.
However, the title lengths vary so much that the height…

Mr Toad
- 202
- 2
- 12
- 41
0
votes
1 answer
Trim tweets from plugin
I am using this Wordpress plugin
https://smashballoon.com/custom-twitter-feeds/demo
I would like to trim the Tweets to 120 characters.
I have no JS skills and very little php - I tried this which I found but I don't know if it's relevant at…

Mr Toad
- 202
- 2
- 12
- 41
0
votes
3 answers
rtrim anything starting with a specific set of characters
Sorry I don't have any code to post to be discussed, it's one simple question
How to rtrim a string beginning from a set of characters?
String: abcdefghijk
What to remove: fghijk
Anything at the end of the string that starts (the part to be removed)…

medk
- 9,233
- 18
- 57
- 79
0
votes
2 answers
How can I remove the last empty space from my string inside array?
I am creating a array from a file:
$handle = fopen("inputfile.txt", "r");
if ($handle) {
while (($str = fgets($handle)) !== false) {
if (strlen($str) && $str[0] == '#') {
$pdate = substr($str, 1);
…

peace_love
- 6,229
- 11
- 69
- 157
0
votes
1 answer
while loop with operator++ only counting up once
I adopted code from https://stackoverflow.com/a/44553006/8719001
but can't figure out why when uploading the same file "test.jpg" several times it only counts up once, creating "test-1.jpg" but not more ie. test-2.jpg, test-3.jpg.
Can anybody spot…

Markus
- 458
- 4
- 16
0
votes
0 answers
Facing issue while running select query on DB2
I'm querying a DB2 table (STG_TOOL) with 2 columns - T_L_ID - Integer, Name - VARCHAR(20).
SELECT T_L_ID, Name FROM STG_TOOL;
The query returns answer. However, the below query gives error.
SELECT T_L_ID, RTRIM(Name) FROM STG_TOOL;
This query…

Gdek
- 81
- 4
- 11