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


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Writing a loop to manipulate a script and store it in multiple output files
Prev   Next
# 1  
Old 10-05-2011
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

getout.pl.1 through getout.pl.1000. How do I go about doing that? Thanks a lot!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Output Multiple Files in the For Loop

while IFS= read -r line do # sV for version detection nmap -T4 -Pn -v -sS "$line" > "text/$line" done < <(grep '' $file) Hi, where line represents the IP. I am using NMAP to do scanning. How can I set to execute that command in the loop several concurrently at a time instead of one... (5 Replies)
Discussion started by: alvinoo
5 Replies

2. Shell Programming and Scripting

Loop through multiple files in bash script

Hi Everybody, I'm a newbie to shell scripting, and I'd appreciate some help. I have a bunch of .txt files that have some unwanted content. I want to remove lines 1-3 and 1028-1098. #!/bin/bash for '*.txt' in <path to folder> do sed '1,3 d' "$f"; sed '1028,1098 d' "$f"; done I... (2 Replies)
Discussion started by: BabyNuke
2 Replies

3. UNIX for Dummies Questions & Answers

Writing a script to print the number of lines in multiple files

Hi I have 1000 files labelled data1.txt through data1000.txt. I want to write a script that prints out the number of lines in each txt file and outputs it in the following format: Column 1: number of data file (1 through 1000) Column 2: number of lines in the text file Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

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

5. UNIX for Dummies Questions & Answers

Writing a script that will take the first line from each file and store it in an output file

Hi, I have 1000 files names data1.txt through data1000.txt inside a folder. I want to write a script that will take each first line from the files and write them as output into a new file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

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

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

8. Shell Programming and Scripting

Writing a Perl Script that processes multiple files

I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files. I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Discussion started by: evelibertine
10 Replies

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

10. Shell Programming and Scripting

Shell Script to store contents of multiple files into one

Hi, I"m writing a script to store all the contents of multiple files with different file names into one single file. I am giving in only last modified date of file in a folder. The below script gives a list of just one file based on the input date i give which is taken as string variable. I... (2 Replies)
Discussion started by: ashrocks
2 Replies
Login or Register to Ask a Question
DMXGetWindowAttributes(3)				     Library Functions Manual					 DMXGetWindowAttributes(3)

NAME
DMXGetWindowAttributes - determine back-end window attributes SYNOPSIS
#include <X11/extensions/dmxext.h> Bool DMXGetWindowAttributes(Display *dpy, Window window, int *screen_count, int available_count, DMXWindowAttributes *attr); DESCRIPTION
When calling DMXGetWindowAttributes(), window specifies the window ID of a window on the Xdmx(1) server and available_count specifies the length of attr. The number of screens for which information is available will be returned in screen_count and information about those screen will be returned in attr. If screen_count is less than available_count, then information for all of the screens will be returned. Otherwise, information for the first available_count screens will be returned. The DMXWindowAttributes structure is: typedef struct { int screen; Window window; XRectangle pos, vis; } DMXWindowAttributes; For each back-end X server that displays a portion of window, this structure contains the physical screen containing that portion, the win- dow ID on the back-end X server of the window containing that portion, the position and dimensions of the window on the back-end (pos, in screen coordinates), and the visible area of the window on the back-end (vis, in window-relative coordinates -- all zeros if the window is not visible on the backend). To obtain more information about the physical screen use the DMXGetScreenAttributes(3) call. Note that DMX allows multiple back-end windows to overlap in their view of the DMX logical window. Further, a logical window does not have to be completely covered by back-end windows -- there may be gaps. As an example, consider a 500x500 window that spans the top two 1024x768 back-end displays (A and B) of a 2048x1536 DMX display composed of 4 1024x768 back-end displays arranged in a cube: A B C D In this case, the DMXGetWindowAttributes call would return the following information for the 500x500 window: display A: 500x500 window at 1024-250,0 (relative to back end) with 250x500 visible at 0,0 (relative to window origin) display B: 500x500 window at -250,0 (relative to back end) with 250x500 visible at 250,0 (relative to window origin) display C: 500x500 window at 1024-250,-768 with 0x0 visible at 0,0 display D: 500x500 window at -250,-768 with 0x0 visible at 0,0 RETURN VALUE
DMXGetWindowAttributes() returns True unless there is a protocol error. DMXGetWindowAttributes() can generate BadWindow and BadAlloc errors. NOTES
Because this call transports a great deal of information over the wire, please call DMXGetScreenCount(3) first, and make sure attr is suf- ficiently large. On a particular back-end server, it is possible that the associated window has not yet been mapped because the XMapWindow(3) call that will eventually map the window had been buffered by Xlib's normal buffering system. To avoid this race condition, please call DMXSync(3) before communicating directly with the back-end X server. SEE ALSO
DMXGetScreenCount(3), DMXSync(3), DMXGetScreenAttributes(3), DMX(3), Xdmx(1) X Version 11 libdmx 1.1.2 DMXGetWindowAttributes(3)