473,804 Members | 4,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Considering white spaces in search patterns

Hi,

I am running a command like the one given below through a process:

abc d:\myfolder\xyz _%s.*.log . -now the %s puts a string which may
or may not contain white spaces...
e,g abc d:\myfolder\xyz _EARTH LIFE.*.log
how should i confirm that that the entire string should be taken into
consideration along with the white space in between to run the command
abc on the file xyz_EARTH LIFE.123.log?

Please help....

Aug 22 '07 #1
2 1344
On Tue, 21 Aug 2007 22:42:24 -0700, ro******@gmail. com wrote in
comp.lang.c:
Hi,

I am running a command like the one given below through a process:
What's a process? Do you mean a C program? Are you passing a string
to the system() function?
abc d:\myfolder\xyz _%s.*.log . -now the %s puts a string which may
or may not contain white spaces...
e,g abc d:\myfolder\xyz _EARTH LIFE.*.log
how should i confirm that that the entire string should be taken into
consideration along with the white space in between to run the command
abc on the file xyz_EARTH LIFE.123.log?

Please help....
If you are using the standard C function system(), it depends on your
system's command interpreter or shell, as this is what will actually
parse the string.

If a file name that you pass to the system function might contain
spaces, your shell might need you to quote it. So instead of:

sprintf(buffer, "abc %s", file_name_that_ might_contain_s paces);

....you might try:

sprintf(buffer, "abc \"%s\", file_name_that_ might_contain_s paces);

If that does not work for you, or you are using some method other than
the standard C library system() function, post in a group that
supports your particular platform.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Aug 22 '07 #2
ro******@gmail. com wrote:
I am running a command like the one given below through a process:

abc d:\myfolder\xyz _%s.*.log . -now the %s puts a string which may
or may not contain white spaces...
e,g abc d:\myfolder\xyz _EARTH LIFE.*.log
how should i confirm that that the entire string should be taken into
consideration along with the white space in between to run the command
abc on the file xyz_EARTH LIFE.123.log?
What on earth made you conceive that this could possible be a C
question? How command lines are parsed is up to the shell, not up to any
individual C program. IOW: read your shell's manual, or ask in a
newsgroup which handles MS Windows command.com.

Richard
Aug 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3333
by: qwweeeit | last post by:
Hi all, I need to limit as much as possible the lenght of a source line, stripping white spaces (except indentation). For example: .. . max_move and AC_RowStack.acceptsCards ( self, from_stack, cards ) must be reduced to: .. . max_move and AC_RowStack.acceptsCards(self,from_stack,cards) My solution has been (wrogly): ''.join(source_line.split())
4
3226
by: ucfcpegirl06 | last post by:
Hi, I need help getting rid of trailing white spaces. I am searching a file for various data (not important) and retrieving it. I output the data if found to a file. An example would be: HD='Three blind mice ' My output would consist of: Three Blind Mice (w/ all the white space behind being printed until the quote mark is reached) I don't the white space after the text to be printed.
11
15021
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white spaces(if it more than once between two words). Is there any function we have in C which will find out the tabs and white spaces and returns the text in the follwong way -
4
3601
by: Andreas Prilop | last post by:
How many spaces should be displayed in A <span style="display:none">x</span> B between "A" and "B"? I notice that Mozilla displays one space and Internet Explorer (5 & 6) displays two spaces. See http://www.unics.uni-hannover.de/nhtcapri/temp/white-space.html for a cumulative effect. Why is this important? Instead of "span", think of the "rp" element
3
11514
by: VK | last post by:
If it was already answered somewhere, I'll be glad to be pointed to (after the necessary comments on my search abilities :-) I need as booletproof as possible way to strip out whitespaces from between tag borders in the source code. 1) left border defined by gt sign > 2) right border defined by lt sign < 3) If the content between left and right borders consists only of white spaces it has to be removed.
22
3077
by: Brent | last post by:
I want to paste a lengthly text document into a web page and have it retain all of whitespace and line breaks. I first tried the <pretag but that didn't work because it doesn't wrap the text. I then moved to CSS and the white-space property, but I can't seem to get it to work either. white-space: pre does the same as <preand white-space: pre-wrap doesn't seem to be supported by any browsers I've tested with. I tried word-wrap:...
12
7226
by: JA | last post by:
Is there a way to remove all the white space in the fields? I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces and replacing them with none. I don't want to replace single spaces, those are the spaces between the words. But most of what is in the fields has been cut-n-pasted from online forms, and the results can be VERY spread out. I could probably save 80% of the space if I could get rid of the extra white space....
8
1930
by: KingKen | last post by:
I have created a search form for my access database. this form submits the table name, the field name and the search text. After identifying the table to search i then use this clause in my SQL statement to find the results WHERE " & myfield & " = '" & mySchTxt & "'" This works fine when mySchTxt is a single word string. Problem is mySchTxt could sometimes be a string of two or more words or even a number and that's when the errors flow....
5
1631
by: Lawrence Krubner | last post by:
I'm suppose to track FTP uploads to the server. I've got a cron script, written in PHP, that runs every 5 minutes and which does the command lsof | grep vsftpd This gives me a big file that has data like this in it: vsftpd 12316 lawrence cwd DIR 9,2 4096 20938763 /data/ftp/lawrence_krubner
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10076
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.