473,396 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to search for a file using C?

170 100+
hi all,

i've got a long long program that does deletion in excel file
but this excel files get it's information from a text file

i would like to automate things a little here
wondering if there's any way where i could search for the file in a particular directory?
cos my current program requires me to manually key in the name of my file that i'm getting my data from

i'm using C in windows
thanks
:)
Feb 25 '08 #1
5 2171
gpraghuram
1,275 Expert 1GB
hi all,

i've got a long long program that does deletion in excel file
but this excel files get it's information from a text file

i would like to automate things a little here
wondering if there's any way where i could search for the file in a particular directory?
cos my current program requires me to manually key in the name of my file that i'm getting my data from

i'm using C in windows
thanks
:)

Usually searching for a file in the system involves scripting like perl or Shell script and it works very well.
So you can have a wrapper script to search for the file and pass that as argument to the C Executable
Raghuram
Feb 25 '08 #2
poolboi
170 100+
yeah i know of perl and stuff
but i've got a script already in mostly C
dun wanna mess it up which why i'm trying to figure out if in C i can just detect a file automatically using C language so that the program will go to that file and get its data?
so any ideas?
Feb 25 '08 #3
gpraghuram
1,275 Expert 1GB
yeah i know of perl and stuff
but i've got a script already in mostly C
dun wanna mess it up which why i'm trying to figure out if in C i can just detect a file automatically using C language so that the program will go to that file and get its data?
so any ideas?

I havent done anything of this sort, so i think other members can help u
Raghuram
Feb 25 '08 #4
poolboi
170 100+
ok, thanks a lot anyway
anyone who knows? help appreciated
Feb 25 '08 #5
mac11
256 100+
ok, thanks a lot anyway
anyone who knows? help appreciated
I've use c in linux to search for a file inside a folder. I'm not sure if it applies to windows land or not but if your stuck maybe it's worth your time to see if you have opendir() and readdir() calls available.

Here is a page that explains them:
http://www.opengroup.org/onlinepubs/...h/readdir.html
Feb 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Anand Pillai | last post by:
To search a word in a group of words, say a paragraph or a web page, would a string search or a regexp search be faster? The string search would of course be, if str.find(substr) != -1:...
3
by: RiceGuy | last post by:
Hi! I'm looking for ideas on what would the best approach to design a search system for a RSS feeds. I will have some 50 RSS feeds (all RSS 2.0 compliant) stored locally on the web server. Now I'm...
1
by: Filip | last post by:
Hi All, a while ago I had to write a asp.net search application. The start page is a html page, which calls a aspx file that shows the search results, using a datagrid. So far no problem. But:...
13
by: Ray Muforosky | last post by:
Hello all: Task: I want to do file search, using the "conatining text" option from a web page. How do I search for a file on my local drive containing a certain string, from a web page. That...
4
by: zakhirn | last post by:
Hello, I have an extremely new user to XML and XSL, and I would like to know how to search XML data via a input form in HTML, and have the results displayed in HTML. If anyone has code that...
4
by: Dameon | last post by:
Hi All, I have a process where I'd like to search the contents of a file(in a dir) for all occurences (or the count of) of a given string. My goal is to focus more on performance, as some of the...
8
by: stunna | last post by:
Hi there, i want to implement a a system to search for a file in a folder using the file name and if its there, i want it to be displayed. I have one through a couple of books on how to implement...
4
by: ravindarjobs | last post by:
hi...... i am using ms access 2003,vb6 i have a form. in that i have 2 buttons 1. start search 2 stop search when i click the "start search" button the fucntion SearchSystem() is called,...
3
by: =?Utf-8?B?UGVycmlud29sZg==?= | last post by:
Not sure where to post this... Found some interesting behavior in Windows Search (Start =Search =All files and folders =search for "A word or phrase in the file:"). This applies to XP and maybe...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.