How to process multiple input files using Shell scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to process multiple input files using Shell scripting
# 1  
Old 09-27-2011
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 the output as X.2 and so on all the way up to 1000.txt.

How do I write a for loop that achieves that? Thank you! Smilie

Last edited by jim mcnamara; 09-27-2011 at 03:40 PM.. Reason: Closed: duplicate thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies

2. Shell Programming and Scripting

Shell Scripting - Select multiple files from numbered list

I am trying to have the user select two files from a numbered list which will eventually be turned into a variable then combined. This is probably something simple and stupid that I am doing. clear echo "Please Select the Show interface status file" select FILE1 in *; echo "Please Select the... (3 Replies)
Discussion started by: dis0wned
3 Replies

3. 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

4. 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

5. Shell Programming and Scripting

How to Process input files from folder in shell script?

Hi, I want to process all input files available into folder (C:\ShellPrg\InputFile\) Input files are abc.CSV , XYZ.zip (zip of CSV file), PQR.gz (zip of CSV file). I want to check the extension of file, If its .zip/.gz then need to unzip the file as .CSV I want to parse line by line of... (2 Replies)
Discussion started by: Poonamol
2 Replies

6. Shell Programming and Scripting

Background Process Shell Scripting

I have a following program: echofunc() { filename=$1 echo "reading $filename" while read line do echo $line; sleep 6; done < $filename } split -5 new.dat ls x* > input.dat while read file do echofun $file & done < input.dat (3 Replies)
Discussion started by: dhieraj
3 Replies

7. 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
bntext(5)							File Formats Manual							 bntext(5)

NAME
bnmotd.txt, bnnews.txt bnissue.txt - messages for the Unix Battle.net daemon DESCRIPTION
The file bnmotd.txt contains text displayed by bnetd(1), when users first log into the server. The file bnnews.txt contains text displayed when the user uses the /news chat command. The files consist of raw text with printf-style formatting escapes. Each line of a file can contain a type formatter from the following list: %B Use the broadcast attribute (???). %C Execute the line as if the user entered it as a command. %E Use the error attribute (red). %I Use the info attribute (yellow). This is the same was %W. %M Normal chat message (white). This will appear as if the user said it. %T Emote chat message (???). This will appear as if the user said it. %W Use the warning attribute (yellow). This is the same was %I. Within a line, any of the following format formatters may be used: %% Expand to a literal percent sign (%). %a Expand to the number of accounts on the server. %c Expand to the number of channels on the server. This includes all permanent and current temporary channels. %g Expand to the number of games on the server. This includes both public and private (passworded) games. %h Expand to the hostname of the server (as returned by gethostname(2)). %i Expand to this user's account ID number, formatted with a leading pound (#) sign and leading zeros. %l Expand to this user's current chat name which is usually the same %r Expand to the IP of the remote machine (the client). %t Expand to four character client tag. %u Expand to the number of users logged into the server. %v Expand to the version number of the server. SEE ALSO
bnetd(1) AUTHOR
Ross Combs (ross@bnetd.org) 2 August, 2001 bntext(5)