Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Writing a loop to process multiple input files by a shell script Post 302563598 by Corona688 on Tuesday 11th of October 2011 04:59:24 PM
Old 10-11-2011
What's your system?

What's your shell?

You've already been given a perl solution, what was wrong with it?
 

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
Mojo::URL(3pm)						User Contributed Perl Documentation					    Mojo::URL(3pm)

NAME
Mojo::URL - Uniform Resource Locator SYNOPSIS
use Mojo::URL; # Parse my $url = Mojo::URL->new('http://sri:foobar@kraih.com:3000/foo/bar?foo=bar#23'); say $url->scheme; say $url->userinfo; say $url->host; say $url->port; say $url->path; say $url->query; say $url->fragment; # Build my $url = Mojo::URL->new; $url->scheme('http'); $url->userinfo('sri:foobar'); $url->host('kraih.com'); $url->port(3000); $url->path('/foo/bar'); $url->path('baz'); $url->query->param(foo => 'bar'); $url->fragment(23); say $url; DESCRIPTION
Mojo::URL implements a subset of RFC 3986 and RFC 3987 for Uniform Resource Locators with support for IDNA and IRIs. ATTRIBUTES
Mojo::URL implements the following attributes. "authority" my $authority = $url->authority; $url = $url->authority('root:pass%3Bw0rd@localhost:8080'); Authority part of this URL. "base" my $base = $url->base; $url = $url->base(Mojo::URL->new); Base of this URL. "fragment" my $fragment = $url->fragment; $url = $url->fragment('foo'); Fragment part of this URL. "host" my $host = $url->host; $url = $url->host('127.0.0.1'); Host part of this URL. "port" my $port = $url->port; $url = $url->port(8080); Port part of this URL. "scheme" my $scheme = $url->scheme; $url = $url->scheme('http'); Scheme part of this URL. "userinfo" my $userinfo = $url->userinfo; $url = $url->userinfo('root:pass%3Bw0rd'); Userinfo part of this URL. METHODS
Mojo::URL inherits all methods from Mojo::Base and implements the following new ones. "new" my $url = Mojo::URL->new; my $url = Mojo::URL->new('http://127.0.0.1:3000/foo?f=b&baz=2#foo'); Construct a new Mojo::URL object. "clone" my $url2 = $url->clone; Clone this URL. "ihost" my $ihost = $url->ihost; $url = $url->ihost('xn--bcher-kva.ch'); Host part of this URL in punycode format. # "xn--da5b0n.net" Mojo::URL->new('http://X.net')->ihost; "is_abs" my $success = $url->is_abs; Check if URL is absolute. "parse" $url = $url->parse('http://127.0.0.1:3000/foo/bar?fo=o&baz=23#foo'); Parse URL. "path" my $path = $url->path; $url = $url->path('/foo/bar'); $url = $url->path('foo/bar'); $url = $url->path(Mojo::Path->new); Path part of this URL, relative paths will be appended to the existing path, defaults to a Mojo::Path object. # "http://mojolicio.us/DOM/HTML" Mojo::URL->new('http://mojolicio.us/perldoc/Mojo')->path('/DOM/HTML'); # "http://mojolicio.us/perldoc/DOM/HTML" Mojo::URL->new('http://mojolicio.us/perldoc/Mojo')->path('DOM/HTML'); # "http://mojolicio.us/perldoc/Mojo/DOM/HTML" Mojo::URL->new('http://mojolicio.us/perldoc/Mojo/')->path('DOM/HTML'); "query" my $query = $url->query; $url = $url->query(replace => 'with'); $url = $url->query([merge => 'with']); $url = $url->query({append => 'to'}); $url = $url->query(Mojo::Parameters->new); Query part of this URL, defaults to a Mojo::Parameters object. # "2" Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query->param('b'); # "http://mojolicio.us?a=2&c=3" Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query(a => 2, c => 3); # "http://mojolicio.us?a=2&b=2&c=3" Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query([a => 2, c => 3]); # "http://mojolicio.us?b=2" Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query([a => undef]); # "http://mojolicio.us?a=1&b=2&a=2&c=3" Mojo::URL->new('http://mojolicio.us?a=1&b=2')->query({a => 2, c => 3}); "to_abs" my $abs = $url->to_abs; my $abs = $url->to_abs(Mojo::URL->new('http://kraih.com/foo')); Clone relative URL and turn it into an absolute one. "to_rel" my $rel = $url->to_rel; my $rel = $url->to_rel(Mojo::URL->new('http://kraih.com/foo')); Clone absolute URL and turn it into a relative one. "to_string" my $string = $url->to_string; Turn URL into a string. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::URL(3pm)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy