Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Writing a loop to process multiple input files by a shell script Post 302563604 by Shell_Life on Tuesday 11th of October 2011 05:09:01 PM
Old 10-11-2011
Can this work for you:
Code:
for i in 250.[3-9]* 250.1000; do 
  [ "$i" = 'X.txt' ] || awk 'NR==FNR{A[NR]=$6;next}{$6=A[FNR]}1' "$i" 'X.txt' > "X.${i%.txt}"
done

 

10 More Discussions You Might Find Interesting

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

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

3. UNIX for Dummies Questions & Answers

Writing a for loop that processes multiple input files

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... (1 Reply)
Discussion started by: evelibertine
1 Replies

4. UNIX for Dummies Questions & Answers

Writing a loop to manipulate a script and store it in multiple output files

I have a script where the the 9th line looks like this: $filename=sprintf("250.1chr%d.ped", $N); I want to modify this script 1000 times, changing 250.1chr%d.ped to 250.2chr%d.ped, 250.3chr%.ped.......and so on all the way to 250.1000chr%d.ped and store each output in files called ... (4 Replies)
Discussion started by: evelibertine
4 Replies

5. UNIX for Dummies Questions & Answers

Writing a loop to merge multiple files by common column

I have 100 data files labelled 250.1.txt through 250.100.txt. The second column of the data files partially match (there is about %90 overlap). Each data file has 4 columns. I want the merge all these text files by the matching values in the second column. In the output, the first column should... (1 Reply)
Discussion started by: evelibertine
1 Replies

6. UNIX for Dummies Questions & Answers

Using Shell Script To Loop Program Through Multiple Text Files

Hello, So I have approximately 300 files of raw data (.txt) files that I am using to perform statistical analysis. I have been able to construct a Fortran program that is able to perform my statistical analysis on a file by file basis. However, I now want to be able to loop program through... (19 Replies)
Discussion started by: Jimmyd24
19 Replies

7. UNIX for Dummies Questions & Answers

Writing a for loop to manipulate multiple files

Hi, I have 1000 text files in a folder that are labeled data1.txt all the way to data1000.txt. I want to write a small script that manipulates the text files in this way: (1) cut the 2nd and 9th columns of the text files (2) sort by the numerical value in the 9th column (3) then save the rows... (3 Replies)
Discussion started by: evelibertine
3 Replies

8. Shell Programming and Scripting

FOR loop with multiple files as input and awk

Hi all , i want to pass multiple files as input to a for loop for i in file1 file2 file3 do some awk action < $i >> $i.out done but im getting error in that for loop is the way i use to pass files to awk using for correct and 2.we can directly pass multiple files to awk as... (7 Replies)
Discussion started by: zozoo
7 Replies

9. Shell Programming and Scripting

Bash Question: HowTo Exit Script with User Input While Process is Running Mid-Loop?

Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies

10. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies
GET-IAB(1)						      General Commands Manual							GET-IAB(1)

NAME
get-iab - Fetch the arp-scan IAB file from the IEEE website SYNOPSIS
get-iab [options] DESCRIPTION
get-iab fetches the Ethernet IAB file from the IEEE website, and saves it in the format used by arp-scan. The IAB file contains all of the IABs (Individual Address Blocks) that have been registered with IEEE. Each IAB entry in the file speci- fies the first 36-bits of the 48-bit Ethernet hardware address, leaving the remaining 12-bits for use by the registering organisation. For example the IAB entry "0050C2003", registered to Microsoft, applies to any Ethernet hardware address from 00:50:c2:00:30:00 to 00:50:c2:00:3f:ff inclusive. Each IAB assignment represents a total of 2^12 (4,096) Ethernet addresses. Major Ethernet hardware vendors typically use an OUI registration rather than an IAB registration. See get-oui(1) for details. This script can be used to update the arp-scan IAB file from the latest data on the IEEE website. It is relatively rare to see Ethernet addresses from IAB registrations, so the IAB file is not as important as the OUI file. The IAB data is fetched from the URL http://standards.ieee.org/regauth/oui/iab.txt and the output file is saved to the file ieee-iab.txt in the current directory. The URL to fetch the data from can be changed with the -u option, and the output file name can be changed with the -f option. The ieee-iab.txt file that is produced by this script is used by arp-scan to determine the Ethernet card vendor from its hardware address. The directory that arp-scan will look for the ieee-iab.txt file depends on the options used when it was built. If it was built using the default options, then it will look in /usr/local/share/arp-scan. OPTIONS
-h Display a brief usage message and exit. -f <fn> Write the output to the specified file instead of the default ieee-iab.txt. -u <URL> Use the specified URL to fetch the raw IAB data from instead of the default http://standards.ieee.org/regauth/oui/iab.txt -v Display verbose progress messages. FILES
ieee-iab.txt The default output file. EXAMPLES
$ get-iab -v Renaming ieee-iab.txt to ieee-iab.txt.bak Fetching IAB data from http://standards.ieee.org/regauth/oui/iab.txt Fetched 230786 bytes Opening output file ieee-iab.txt 1535 IAB entries written to file ieee-iab.txt NOTES
get-iab is implemented in Perl, so you need to have the Perl interpreter installed on your system to use it. get-iab uses the LWP::Simple Perl module to fetch the data from the IEEE website. You must have this module installed on your system for it to work. This module is available on most distributions, often called libwww-perl. It is also available in source form from CPAN. You can use a proxy server by defining the http_proxy environment variable. AUTHOR
Roy Hills <Roy.Hills@nta-monitor.com> SEE ALSO
arp-scan(1) get-oui(1) arp-fingerprint(1) http://www.nta-monitor.com/wiki/ The arp-scan wiki page. March 30, 2007 GET-IAB(1)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy