Hi,
I know removing whitespaces I can found so many threads to read how it works and i did it, but my problem isn't solved...
I have in my script a variable $1 which can contains a text like " Channel ".
No I want to check if $1 contains the word Channel, but I don't know how many... (4 Replies)
I'm trying to find a command that will trim the white space off a string.
e.g.
$str = " stuf "
$str = trim ( $str )
echo $str // ouput would just be stuf
Thanks, Mark (4 Replies)
I'm trying to remove the whitespace at the end of each line of a text file in ksh.
Im using
sed s/ $//g' file1.txt > file2.txt
It's not working. Any clues? (3 Replies)
I have a file that I am spliting and parsing, if data starts with an N/n toos it (which works) but I want it to also see if the data is blank and toss it.
What I have does not toss the blank space for dduck????
here is the data file and code I have.....
efudd 7546
bbunny N0542
tdevil... (3 Replies)
Hi
Following is an example line.
echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:"
I want it's output to be
200
However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Hello I am working aon script, that tells me how many users or on the system when i run it.
The script is
#!/bin/bash
w | cut -f 1 -d ' ' |sort -u | wc -l
When ran it shows 16 users including myself and a line of white space.
I was wondering what I need to add to remove my user... (2 Replies)
I have a 13 number string, some whitespace, and then /mp3.
I need to join them. Everyline that I need this for begins with "cd" (without the quotes).
What it looks like now:
cd media/Audio/WAVE/9781933976334 /mp3 What I want my output to be:
cd media/Audio/WAVE/9781933976334/mp3 The 13... (7 Replies)
This is my file
.........hostname.............this is hostname
.........alias...................alias name
Remark use dot(.) instead of whitespace B'cuz this forum not allow to use more whitespace.
---------------------------------------
I sperate by whitespace not work.
awk 'BEGIN {FS=" "}... (4 Replies)
I have a file that looks like this:
102| #2 X 1/4-INCH| 30188| EA| FTW| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #2 X 1/4-INCH
102| #2 X 1/4-INCH| 30188| EA| VPS| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #2 X 1/4-INCH
102| #6 X 1/2"| ... (2 Replies)
Hi again
I have an xml file and want to remove the leading white space as it causes me issues later in my script
I see sed is possible but cant seem to get it to work
I tried
sed 's/^ *//' file.xml
output
<xn:VsDataContainer id="1U104799" modifier="update">
... (10 Replies)
Discussion started by: aniquebmx
10 Replies
LEARN ABOUT PHP
ctype_space
CTYPE_SPACE(3) 1 CTYPE_SPACE(3)ctype_space - Check for whitespace character(s)SYNOPSIS
bool ctype_space (string $text)
DESCRIPTION
Checks if all of the characters in the provided string, $text, creates whitespace.
PARAMETERS
o $text
- The tested string.
RETURN VALUES
Returns TRUE if every character in $text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes
tab, vertical tab, line feed, carriage return and form feed characters.
EXAMPLES
Example #1
A ctype_space(3) example
<?php
$strings = array('string1' => "
", 'string2' => "
arf12", 'string3' => '
');
foreach ($strings as $name => $testcase) {
if (ctype_space($testcase)) {
echo "The string '$name' consists of all whitespace characters.
";
} else {
echo "The string '$name' does not consist of all whitespace characters.
";
}
}
?>
The above example will output:
The string 'string1' consists of all whitespace characters.
The string 'string2' does not consist of all whitespace characters.
The string 'string3' does not consist of all whitespace characters.
NOTES
Note
If an integer between -128 and 255 inclusive is provided, it is interpreted as the ASCII value of a single character (negative val-
ues have 256 added in order to allow characters in the Extended ASCII range). Any other integer is interpreted as a string contain-
ing the decimal digits of the integer.
SEE ALSO ctype_cntrl(3), ctype_graph(3), ctype_punct(3).
PHP Documentation Group CTYPE_SPACE(3)