By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,795 Members | 1,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,795 IT Pros & Developers. It's quick & easy.

Accessing directory

P: n/a
How to take all the text files in a directory as input? I want to open
all the files in a directory and process them.

Otherwise, I need to open all the files in the directory individaully
which is a tedious job. Please guide. Thanks.

Jun 10 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Umesh wrote:
How to take all the text files in a directory as input? I want to open
all the files in a directory and process them.

Otherwise, I need to open all the files in the directory individaully
which is a tedious job. Please guide. Thanks.
Are you related to Kenny?

--
Ian Collins.
Jun 10 '07 #2

P: n/a
"Umesh" <fr****************@gmail.comschrieb im Newsbeitrag
news:11**********************@i38g2000prf.googlegr oups.com...
How to take all the text files in a directory as input? I want to open
all the files in a directory and process them.
In UNIX like systems:

cat * | yourprog

then process stdin, from then on you're on topic here.

Bye, Jojo
Jun 10 '07 #3

P: n/a
"Umesh" wrote:
How to take all the text files in a directory as input? I want to open
all the files in a directory and process them.

Otherwise, I need to open all the files in the directory individaully
which is a tedious job. Please guide. Thanks.
You will have to use operating system facilities to do that, since C doesn't
even acknowledge the existence of directories. So find a new news group and
post your question there. When you post, I suggest you ask *one* clear
question, not two as you do above. "all text files" and "open all the
files" do not mean the same thing. It is what we call, in English,
_ambiguous_, a word you should become familiar with.

Here is one group that might help, but there are many other candidates too.
If you scan this and similar groups, via. Google groups, the answer has
almost certainly been given, probably several times. There might even be a
FAQ for some of these groups that answer your question.

comp.os.msdos.programmer
Jun 10 '07 #4

P: n/a
Umesh <fr****************@gmail.comwrites:
How to take all the text files in a directory as input? I want to open
all the files in a directory and process them.

Otherwise, I need to open all the files in the directory individaully
which is a tedious job. Please guide. Thanks.
Umesh, why would anyone want to help you after the way you've behaved
in this newsgroup? People have answered many of your questions; you
have never acknowledged that help or given any sign that you've
followed, or even understood anyone's advice. Why should we waste our
time?

Please respond to this.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #5

P: n/a
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.orgwrote:
>Umesh <fr****************@gmail.comwrites:
>How to take all the text files in a directory as input? I want to open
all the files in a directory and process them.

Otherwise, I need to open all the files in the directory individaully
which is a tedious job. Please guide. Thanks.

Umesh, why would anyone want to help you after the way you've behaved
in this newsgroup? People have answered many of your questions; you
have never acknowledged that help or given any sign that you've
followed, or even understood anyone's advice. Why should we waste our
time?

Please respond to this.
Why should he waste his time?

Jun 10 '07 #6

P: n/a
>>>>"KMcC" == Kenny McCormack <ga*****@xmission.xmission.comwrites:

KMcCWhy should he waste his time?

Because if he does, and he shows that he appreciates the help and is
learning from it, he may get more.

Charlton
--
Charlton Wilbur
cw*****@chromatico.net
Jun 10 '07 #7

P: n/a
In article <87************@mithril.chromatico.net>,
Charlton Wilbur <cw*****@chromatico.netwrote:
>>>>>"KMcC" == Kenny McCormack <ga*****@xmission.xmission.comwrites:

KMcCWhy should he waste his time?

Because if he does, and he shows that he appreciates the help and is
learning from it, he may get more.
Just in case you haven't figured it out yet, there is no help to be gotten
from this newsgroup - only abuse.

Not that there is anything wrong with that...

Jun 10 '07 #8

P: n/a
Charlton Wilbur <cw*****@chromatico.netwrites:
>>>>>"KMcC" == Kenny McCormack <ga*****@xmission.xmission.comwrites:
[snip]
>
Because if he does, and he shows that he appreciates the help and is
learning from it, he may get more.
KMcC is a troll. Please ignore him.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 10 '07 #9

P: n/a
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.orgwrote:
>Charlton Wilbur <cw*****@chromatico.netwrites:
>>>>>>"KMcC" == Kenny McCormack <ga*****@xmission.xmission.comwrites:
[snip]
>>
Because if he does, and he shows that he appreciates the help and is
learning from it, he may get more.

KMcC is a troll. Please ignore him.
Like you do?

You're not exactly setting a good example.

Jun 10 '07 #10

P: n/a
(Kenny McCormack) wrote:
Keith Thompson <k...@mib.orgwrote:
Umesh <fraternitydispo...@gmail.comwrites:
>[usual Umesh rubbish snipped]
Please respond to this.

Why should he waste his time?
Based on Umesh's posting history, he obviously
has no qualms about wasting his time here.

Jun 10 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.