How do I Process Multiple Files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I Process Multiple Files
# 1  
Old 09-13-2007
How do I Process Multiple Files

Hi,

First post here.

In Mac OSX terminal I need to run a program against multiple files in a directory and append the output to tab separated variable file.

I currently type the following to process just one file

Code:
MBP:/Users/dc1743/Desktop/SFT root# ./myprogram myfile1.plist >> output.tsv

My program and all the files I want to process are in the SFT directory in this example. I want to be able to carry out this process against all of my files in one go rather than one at a time. Please can anyone suggest a command or simple script to achieve this.

As I am sure you can tell I am a complete novice at this.

Regards Richard
# 2  
Old 09-13-2007
Code:
for file in *.plist
do
  /path/to/myprogram $file >> output.tsv
done

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Xargs to call python executable to process multiple bam files

I am running the below loop that to process the 3 bam files (which isn't always the case). A .py executable is then called using | xargs sh to further process. If I just run it with echo the output is fine and expected, however when | xargs sh is added I get the error. I tried adding | xargs... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. Shell Programming and Scripting

Process multiple large files with awk

Hi there, I'm camor and I'm trying to process huge files with bash scripting and awk. I've got a dataset folder with 10 files (16 millions of row each one - 600MB), and I've got a sorted file with all keys inside. For example: a sample_1 200 a.b sample_2 10 a sample_3 10 a sample_1 10 a... (4 Replies)
Discussion started by: camor
4 Replies

3. UNIX for Advanced & Expert Users

How to process multiple files parallely

Hi, I have a requirement to process multiple files in a directory parallely.Consider the below scenario: In a directory there are three files file1,file2 and file3.When I use for loop each file will be executed in sequence but I want to process parallely. Any Help would be appreciated.... (1 Reply)
Discussion started by: liyakathali
1 Replies

4. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

5. UNIX for Dummies Questions & Answers

Writing a loop to process multiple input files by a shell script

I have multiple input files that I want to manipulate using a shell script. The files are called 250.1 through 250.1000 but I only want the script to manipulate 250.300 through 250.1000. Before I was using the following script to manipulate the text files: for i in 250.*; do || awk... (4 Replies)
Discussion started by: evelibertine
4 Replies

6. Shell Programming and Scripting

How to process multiple input files using Shell scripting

Hi, I would like to write a for loop that does the following: I have a file called X.txt and other files called 1.txt,2.txt, .....,1000.txt. I want to substitute the 6th column of the file X.txt with 1.txt and store the output as X.1. Then I want to do the same with X.txt and 2.txt and store... (0 Replies)
Discussion started by: evelibertine
0 Replies

7. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

8. Programming

Process multiple pcap files at once

Hi all, I'm writing a program using libpcap, and I have multiple pcap files in a folder that I want to capture. I currently have handle = pcap_open_offline("/data/traffic/pcap1.pcap", errbuf"); which works fine since pcap_open_offline() takes in a filename. However, I want to process... (0 Replies)
Discussion started by: lancer6238
0 Replies

9. IP Networking

How to choose Multiple process or Multiple threads?

Hi All, Please explain me when i have to use multiple process and when I have to use Multiple threads? Please give me an example.It will be very helpful for me. Thanks in advance. (0 Replies)
Discussion started by: ashleykumar
0 Replies

10. Shell Programming and Scripting

How to process multiple files in Korn Shell

How do I make the below ksh to process all of the files inside a user specified directory? Currently it can only process one file at a time. #!/bin/ksh tr -s '\11 ' ' ' < $1 > temp0 sed -e 's/,//g' temp0 > temp1 cut -d' ' -f1,4,5 temp1 > final_output rm temp0 temp1 (3 Replies)
Discussion started by: stevefox
3 Replies
Login or Register to Ask a Question