Sponsored Content
Top Forums Shell Programming and Scripting Script to move files in multiple folders Post 302758483 by Yoda on Saturday 19th of January 2013 05:56:38 PM
Old 01-19-2013
Here is a bash script:
Code:
#!/bin/bash

c=1; d=1; mkdir -p dir_${d}

for xml_file in *.xml
do
        if [ $c -eq 501 ]
        then
                d=$(( d + 1 )); c=0; mkdir -p dir_${d}
        fi
        echo mv "$xml_file" dir_${d}/
        c=$(( c + 1 ))
done

Note: Remove the highlighted echo if the output looks good.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving multiple folders/files in subversion using bash script

Hi, I'm new here an dlearning a lot from this forum. i didnt find any solution for this in the forum. I have already checked in folders in subversion named HTT01,... HTT21.. and have files in each folder like below: HTT01/HTT01_00000.hex HTT01/HTT01_00000_fb_result.hex... (2 Replies)
Discussion started by: ravishan21
2 Replies

2. UNIX for Dummies Questions & Answers

Move folders containing certain files

Hello, How can I move just the folders that contains files modified n days ago? Source tree: |-- SourceFolder | |-- Subfolder1 | | |-- file1.dat | | `-- file2.dat | |-- Subfolder2 | | |-- filea.dat | | `-- fileb.dat Destination tree: |-- ... (3 Replies)
Discussion started by: xavix
3 Replies

3. Shell Programming and Scripting

Shell script to move files to 3 different folders

Hi guys: I've got this problem, I want to move a bunch of files to 3 different folders, without any specific order, and I'm trying to automatize it with a shell script. I'm a newbie at shell scripting so this is my first try: #!/bin/bash COUNTER=`ls -1 | wc -l` while do ARRAY=(... (11 Replies)
Discussion started by: wretchedmike
11 Replies

4. Shell Programming and Scripting

Move files to Folders

Hi Friends, Below is my requirement and i am not clear how to approach this issue in unix programming. I have a folder with 2500 files. The files are in below format. 1234_name1.txt 1234_name123.txt 4567_name1.txt 4567_name123.txt and i need a program which will read each file from this... (5 Replies)
Discussion started by: diva_thilak
5 Replies

5. Shell Programming and Scripting

Help with auto-detect new files/folders then zip and move script

Hello, I need a simple script to Auto-detect new files and folders in the directory. And then I need to zip the new files and bzip2 new folders and move them out of that folder where I am detecting changes to the other folder. Remember, I need simple one. If anyone could do it fast, I may... (1 Reply)
Discussion started by: juzt1s
1 Replies

6. Shell Programming and Scripting

Move all files but not folders to a new folder

Hi, I have a sub directory with a number of files and folders. What i want is a subdirectory with just folders and not files for cleanliness sake. So I want to move the files into the new folder but keep the folders in the same place. Move all files (but not folders) to new folder. I am... (4 Replies)
Discussion started by: Hopper_no1
4 Replies

7. UNIX for Advanced & Expert Users

Move folders from Multiple remote Servers to my local computer

I have 20 Servers (They are Windows 2003) that I remote every day using names or IP address and type in my username & Password then copy folders manually to my local computer. I'm wondering if i can just run script(s) from my local computer to do this job without using FTP(because of security... (5 Replies)
Discussion started by: idiazza
5 Replies

8. Shell Programming and Scripting

Shell Script to delete files within a particular time frame under multiple sub folders

Greetings! I'm looking for starting information for a shell script. Here's my scenario: I have multiple folders(100) for example: /www/test/applications/app1/logs /www/test/applications/app2/logs Within these folders there are log files files that need to be deleted after a month. ... (3 Replies)
Discussion started by: whysolucky
3 Replies

9. Shell Programming and Scripting

Move only folders and skipping files

How do I move all folders and its contents from a directory A to another directory B, skipping all files in Directory A ? ---------- Post updated at 12:53 PM ---------- Previous update was at 12:42 PM ---------- Ok. Got it. mv /A/*/ /B/ (1 Reply)
Discussion started by: DHeisenberg
1 Replies

10. Shell Programming and Scripting

Move multiple files 4rm Source to different target folders based on a series num in the file content

Dear Experts my scenario is as follows... I have one source folder "Source" and 2 target folders "Target_123456" & "Target_789101". I have 2 series of files. 123456 series and 789101 series. Each series has got 3 types of fiels "Debit", "Refund", "Claims". All files are getting... (17 Replies)
Discussion started by: phani333
17 Replies
OutputFormat(3pm)					  LogReport's Lire Documentation					 OutputFormat(3pm)

NAME
Lire::OutputFormat - Base interface for all OutputFormats. SYNOPSIS
use base qw/ Lire::OutputFormat /; DESCRIPTION
The Lire::OutputFormat objects are used to This package defines the interface which is implemented by all the different OutputFormat that Lire is able to produce. It is this object which has the responsability to convert the XML report to its final format. META INFORMATION METHODS
The Lire::OutputFormat interface extends the Lire::Plugin interface, so they must implement all standard meta-information methods (name(), title(), description()). missing_requirements() This method is queried at runtime to determine if any requirements are missing. It should return an array of messages explaining each missing requirements for the format. FORMATTING A REPORT
format_report( $xml_file, $output_file, $format_cfg ) This method should format the XML report contained in $xml_file into the $output_file (or directory). Additional configuration options are passed in the $format_cfg Lire::Config::TypeSpec object specific to the plugin. mime_report( $xml_file, $format_cfg ) WHen this method is invoked it, the plugin should format the report contained in $xml_file and MIME encapsulate it a MIME::Entity object which is return. Formatting options can be be in the $format_cfg Lire::Config::TypeSpec object. SEE ALSO
Lire::ReportJob(3pm) Lire::OutputJob(3pm) AUTHOR
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: OutputFormat.pm,v 1.6 2006/07/23 13:16:29 vanbaal Exp $ COPYRIGHT
Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 OutputFormat(3pm)
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy