Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Split files based on user input Post 302940453 by Deena1984 on Monday 6th of April 2015 03:26:50 AM
Old 04-06-2015
Thanks for the reply.

each original file has more than 10000 lines.

Sample Input for PxyType

Code:
<proxyType>CommodityCapFloor</proxyType>
<proxyType>CommodityCapFloor</proxyType>
<proxyType>commSwap</proxyType>
<proxyType>commCap</proxyType>

Output Expected:

For eg, If users inputs "commCap" and it matches 1000 lines in $myfile, I need to have 1000 files (1000 *.json) generated

Wi ll that make clear..

Last edited by Don Cragun; 04-06-2015 at 04:44 AM.. Reason: Add CODE tags, again.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

split files based on size

I have a few txt files in some directory and I need to check their sizes one by one. If any of them are greater than 5mb then I need to split the file in two. Can someone help? Thanks. (6 Replies)
Discussion started by: khanvader
6 Replies

2. Shell Programming and Scripting

Script to split files based on number of lines

I am getting a few gzip files into a folder by doing ftp to another server. Once I get them I move them to another location .But before that I need to make sure each gzip is not more than 5000 lines and split it up . The files I get are anywhere from 500 lines to 10000 lines in them and is in gzip... (4 Replies)
Discussion started by: gubbu
4 Replies

3. Shell Programming and Scripting

Split a file into multiple files based on the input pattern

I have a file with lines something like. ...... 123_start ...... ....... 123_end .... ..... 456_start ...... ..... 456_end .... ..... 789_start .... .... 789_end (6 Replies)
Discussion started by: abinash
6 Replies

4. Shell Programming and Scripting

Append file based upon user input-- solved

Ok, I have a script with a commandline option that allows the user to add a custom function to the script file. I have tried everything in my limited knowledge of sed to get this to work and keep coming up short. I need sed to search for a line starting with a pattern, I've got that part so far,... (0 Replies)
Discussion started by: DC Slick
0 Replies

5. Shell Programming and Scripting

Search on date range of file based on user input

Hello I would like to ask for help with a script to search a directory that contains many log files and based on a users input after being prompted, they enter a date range down to the hour which searches the files that contain that range. I dont know how to go about this. I am hoping that the... (5 Replies)
Discussion started by: lostincashe
5 Replies

6. Shell Programming and Scripting

Script interacts with user , based on user input it operates

i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled. #!/bin/sh echo " Enter your choice to continue y/Y OR n/N to quit " read A if then echo " user requested to continue " ##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies

7. Shell Programming and Scripting

Split: File into multiple and keeping the same 3 lines from input into all output files

The following code will split the infile into multiple files. However, I need it to insert the same first 3 lines from the original input file into each splitted file. How do I modify my script below to do so: print -n "Enter file name to split? " ; read infile if then echo "Invalid file... (4 Replies)
Discussion started by: mrn6430
4 Replies

8. Shell Programming and Scripting

Split a non delimited file into columns depending on user input

I would like some advice on some code. I want to write a small script that will take an input file of this format 111222233334444555666661112222AAAA 2222333445556612323244455445454545 2334556345643534505435345353453453 (and so on) It will be called as : script inputfile X (where X is... (5 Replies)
Discussion started by: onlyforbopi
5 Replies

9. Shell Programming and Scripting

awk command to search based on 5 user input fields

Field1=”” Field2=”” Field3=”” Field4=”” Field5=”” USER INPUT UP TO 5 FIELDS awk -F , '{ if ( $3 == Field1 && $6 == Field2 && $8 == Field3 && $9 == Field4 && $10 == Field5) print $0 }' /tmp/rodney.outD INPUT FILE (Rodney.outD): ... (3 Replies)
Discussion started by: rmerrird
3 Replies

10. Shell Programming and Scripting

Automaticaly create function based off user input

I am trying to create a bash script that will create new function by using the user input. The below will create the necessary files in the correct format, however when it comes to the # create function I am at a loss. If the name entered was NEWNAME and the genes were GENE1,GENE2 then two files... (0 Replies)
Discussion started by: cmccabe
0 Replies
Dotur(1)						      General Commands Manual							  Dotur(1)

NAME
dotur - A program for calculating descriptive statistics for sequence libraries SYNOPSIS
dotur [-i Iterations (<1000>)] [-c ClusterMethod (<f>, n, a)] [-p Precision (10, <100>, 1000, 10000)] [-l] [-j] <file> OPTIONS
-i: Number of iterations (default = 1000) -c: Clustering method - (f) furthest neighbor, (n) nearest neighbor, (a) average neighbor (default = f) -p: Precision of distances for output, increasing can dramatically lengthen execution times - 10, 100, 1000, 10000 (default = 100) -l: Input file is lower triangular (default = square matrix) -r: Calculates rarefaction curves for each parameter, can dramatically lengthen execution times. Simple rarefaction curve always calcu- lated. -stop: Stops clustering when cutoff has been reached. -wrep: Samples with replacement. -jumble: Jumble the order of the distance matrix. -sim: Converts similarity score to distance (D=1-S). DESCRIPTION
This is the Debian GNU/Linux version of dotur. DOTUR is a computer program that takes a distance matrix describing the genetic distance between DNA sequence data and assigns sequences to operational taxonomic units (OTUs) using either the furthest, average, or nearest neighbor algorithms for all possible distances that can be described using the distance matrix. Using the OTU composition data, DOTUR constructs collector's and rarefaction curves for sampling intensity, richness estimators, and diversity indices. AUTHOR
This manual page was compiled from the package description and the output of help2man by Thorsten Alteholz <debian@alteholz.de>, for the Debian GNU/Linux system (but may be used by others). DOTUR
June 03, 2011 Dotur(1)
All times are GMT -4. The time now is 08:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy