spaces

Parsing XML files with Java and spaces in file path

I have files on my file system, on Windows XP. I want to parse them using Java (JRE 1.6). Problem is, I don't understand how Java and Xerces work together when the file path has spaces in it. If the file has no spaces in its path, all works fine. If there are spaces, I may have this kind of trouble, even if I call the parser with a Fi...

How do I replace tabs with spaces within variables in PHP?

$data contains tabs, leading spaces and multiple spaces, i wish to replace all tabs with a space. multiple spaces with one single space, and remove leading spaces. in fact somthing that would turn Input data: [    asdf asdf     asdf           asdf   ] Into output data: [asdf asdf asdf asdf] How do i do this? ...

using PHP to rename files with spaces

I've got files with spaces in their names that are already on my server. I want to rename them with underscores. I've tried putting a slash before the space, and I've tried replacing the space with %20. Still PHP gives me: No such file or directory. Here's my code: $dir = './'; $dhandle = opendir($dir); $old_files = array(); if ($dhand...

Why doesn't this Regular Expression match a space?

I have the following regular expression: ([0-9]+),'(.)':([0-9]+),(L|R|'.') It matches this just fine: 1,'a':1,R However, if I replace a with a space, it fails: 1,' ':1,R Why doesn't . match it? Is a space not classified as a character? I can't use \s because I don't want to match tabs and line breaks. I also tried: ([0-9]+),'(....

Spaces in textfield from text-variable: php+html

Hi guys, i have a strange problem... I'm getting string-data from db: $siteDesc = strval( $configHandle->getConfigValue( 'SITE_DESCRIPTION' ) ); var_dump( $siteDesc ); It returns: string(19) "Some description..." But in code: <input type="field" name="site_desc" value="<?=$siteDesc;?>" /> There is a lo of spaces in textfiel...

Removing space character between two image elements

There are 2 small images on a page: <a href="link.htm"><img src="image1.jpg" /></a> <a href="link2.htm"><img src="image2.jpg" /></a> When they appear on the page, they do not appear directly next to each other like I would expect, they appear with a space character between them. I sort of understand why this space is appearing (ther...

How to remove all spaces and tabs from a given string in C language?

What C function, if any, removes all preceding spaces and tabs from a string? Thanks. ...

Need help with Windows Speech Recognition script to compound a string

The command below for Windows Speech Recognition forces the speech recognition engine to use literal text (""all seventy six people paid five dollars") instead of the default ("all 76 people paid $5"). I'm trying to adapt this command to remove the spaces between words so that I could program using speech by saying things like: "Securi...

Getting spaces with Boost::regex

I have a chunk of text like: Name=Long John Silver;Profession=cook;Hobby=Piracy And using the Boost::regex library I am trying to get the value of each attribute so I have the following regular expression for Name: regex(".*Name=([^;$]*).*") I understand it as "get everything after Name= until you find a ; or the end of line". How...

How to run exe in powershell with parameters with spaces and quotes

How do you run this command in powershell: C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe -verb:sync -source:dbfullsql="Data Source=mysource;Integrated Security=false;User ID=sa;Pwd=sapass!;Database=mydb;" -dest:dbfullsql="Data Source=.\mydestsource;Integrated Security=false;User ID=sa;Pwd=sapass!;Database=mydb;",computername=10...

C# - Remove spaces in HTML source in between markups?

I am currently working on a program that allows me to enter HTML source code into a RichTextBox control and removes the spaces from in between markups. The only problem is, I am not sure how I can differentiate between the spaces BETWEEN the markups and the spaces INSIDE the markups. Obviously, removing the spaces inside the markups wo...

Is there a text editor that will automatically determine whether to indent with spaces or tabs?

It's very easy to set a text editor to use spaces or tab characters with each press of the tab key. However, I'm working with a grip of Python code maintained by a large team of developers in my company, and some use spaces and some use tabs. I cannot simply make them all conform with each other, because 1) it would break git blame, 2) i...

Space code in C#

Not literally code from space however: I'm wondering if there's a more OO way if creating spaces in C#. I currently have tabs += new String(' '); and I can't help but feel that this is somewhat reminiscent of using '' instead of String.Empty. What can I use to create spaces that isn't ' '? ...

In Perl, how can I get the fields in this CSV string into an array without spaces?

Hi, if I have a string, say: my $string = "A, B,C, D , E "; How can I put this into an array in Perl without the leading and trailing spaces? So what I want is only a single letter in each array element. What I currently do is this: my @groups = split /,\s*/, $string; But this is obviously not enough, as the trailing spaces are st...

How to replace whitespaces and tabs with nothing in C?

Hi, I wrote this function: void r_tabs_spaces(char *input) { int i; for (i = 0; i < strlen(input); i++) { if (input[i] == ' ' || input[i] == '\t') input[i] = ''; } } However when I compile this and run it, the compiler complains that "error: empty character constant" at line where...

R: 0-1 sequence without spaces?

Spaces are redundant when reporting a binary sequence. This code x <- '1 0 0 0 0 0 1 1 0 1 0 1 1 0 ' y<-gsub(' +', '', x) does the job so I can copy and paste from R. How do I do the same for 0-1 sequences (and other one-digit data) in others formats, e.g., x <- c(1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0) or toString(x) or whate...

How to calculate the number of characters(spaces are excluded) within a pair of tags in JQuery or Javascript?

How to calculate the characters(spaces are excluded) within a pair of tags in JQuery or Javascript? What function? For example: <pre id="mytext">This is the text. This is the text.</pre> How to know how many characters or words in $("#mytext")? ...

Preventing an application from being moved between spaces

Working on an application that contains legacy Carbon code (mixed with some Cocoa). It is a full screen app (not technically, it just draws itself as though it were) that hides the dock and application menu bar when active. What I'd like to do is prevent the application from being allowed to move between Spaces. Basically, if the user a...

Eclipse Spaces & Tabs

I like to display 4 spaces as tab in eclipse, with an actual width on the screen of 2 spaces. When I save the file, I'd like to have 4 spaces (represented as «.») for a tab: 1st.level ....2nd.level ........3rd.level In eclipse, I'd like to see this, where a tabstop (represented as «->>») should take the width of two spaces: 1st....

Linux - Replacing spaces in the file names

I have a number of files in a folder, i want to replace every space character in all file names with under scores. How can I achieve this? ...