Sponsored Content
Top Forums Shell Programming and Scripting How to split a data file into separate files with the file names depending upon a column's value? Post 302558757 by itkamaraj on Sunday 25th of September 2011 07:38:24 AM
Old 09-25-2011
Code:
awk -F\| '{print > $1"_xyz.dat"}' inputfile

This User Gave Thanks to itkamaraj For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

split file depending on content

Hi, I have a file which contains records of data. I need to split the file into multiple files depending upon the value of last field. How do i read the last field of each record in the file??? Regards, Chaitrali (4 Replies)
Discussion started by: Chaitrali
4 Replies

2. Shell Programming and Scripting

Split file into multiple files depending upon first 4 digits

Hi All, I have a file like below: 1016D"ddd","343","1299" 1016D"ddd","3564","1299" 1016D"ddd","3297","1393" 1016D"ddd","32989","1527" 1016D"ddd","346498","1652" 2312D"ddd","3269","1652" 2312D"ddd","328","1652" 2312D"ddd","2224","2100" 3444D"ddd","252","2100" 3444D"ddd","2619","2100"... (4 Replies)
Discussion started by: deepakgang
4 Replies

3. Shell Programming and Scripting

Using AWK to separate data from a large XML file into multiple files

I have a 500 MB XML file from a FileMaker database export, it's formatted horribly (no line breaks at all). The node structure is basically <FMPXMLRESULT> <METADATA> <FIELD att="............." id="..."/> </METADATA> <RESULTSET FOUND="1763457"> <ROW att="....." etc="...."> ... (16 Replies)
Discussion started by: JRy
16 Replies

4. UNIX for Dummies Questions & Answers

How to separate a single column file into files of the same size (i.e. number of rows)?

I have a text file with 1,000,000 rows (It is a single column text file of numbers). I would like to separate the text file into 100 files of equal size (i.e. number of rows). The first file will contain the first 10,000 rows, the second row will contain the second 10,000 rows (rows 10,001-20,000)... (2 Replies)
Discussion started by: evelibertine
2 Replies

5. Shell Programming and Scripting

find specific file names and execute a command depending on file's name

Hi, As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
Discussion started by: armando110
3 Replies

6. Shell Programming and Scripting

Divide data with specific column values into separate files

hello! i need a little help from you :) ... i need to split a file into separate files depending on two conditions using scripting. The file has no delimiters. The conditions are col 17 = "P" and col 81 = "*", this will go to one output file; col 17 = "R" and col 81 = " ". Here is an example. ... (3 Replies)
Discussion started by: chanclitas
3 Replies

7. Shell Programming and Scripting

How to Split File to 2 depending on condition?

Hi , cat myfile.txt ! 3100.2.0.5 ! 3100.2.22.4 ! 3100.2.30.33 ! 3100.2.4.1 ! ! 3100.2.0.5 ! 3100.2.22.4 ! 3100.2.22.11 ! 3100.2.4.1 ! ! 3100.2.0.5 ! 3100.2.2.50 ! 3100.2.22.11 ! 3100.2.4.1 ! ! 3100.2.0.5 ! 3100.2.22.4 ! 3100.2.30.33 ! 3100.2.4.1 ! ! 3100.2.0.5 ! 3100.2.22.4 !... (6 Replies)
Discussion started by: OTNA
6 Replies

8. Shell Programming and Scripting

Split file depending on Column Value

Hi , my file look likes below , cat file.csv 12/09/2014,50,5,0,300 12/09/2014, ,5,0,300 12/09/2014,50,,,300 i need to split file , the first one contains values (2nd column is 50 , 3rd and fourth column is null ) the second file contains all others firstfile ... (2 Replies)
Discussion started by: ubaisalih
2 Replies

9. UNIX for Dummies Questions & Answers

Split larger files into smaller ones with Column names

Hi, I have one large files of 100000 rows with header column. Eg: Emp Code, Emp Name 101,xxx 102,YYY 103,zzz ... ... I want to split the files into smaller files with only 30000 rows each..File 1,2 and 3 must have 30000 rows and file 4 must contain 10000 rows. But the column... (1 Reply)
Discussion started by: Nivas
1 Replies

10. Shell Programming and Scripting

How to separate data coming in one column of CSV file?

I am running an ISQL command on Sybase DB and getting output of a query in an CSV file. The issue is that all the data comes in to the same column, i want them to be separated in different columns. SQL_COMMAND=command.sql file=file.txt formatFile=formatFile.txt report=report.csv echo... (1 Reply)
Discussion started by: Sharma331
1 Replies
DH_MAKECLILIBS(1)				Debhelper for CLI (Common Language Infrastructure)				 DH_MAKECLILIBS(1)

NAME
dh_makeclilibs - automatically create clilibs file SYNOPSIS
dh_makeclilibs [debhelper options] [-r] [-V[dependancies]] [-mminversion] [-lnextincompatible] [-Xitem] DESCRIPTION
dh_makeclilibs is a debhelper program that automatically scans for versioned CIL (.NET) assemblies, and generates a clilibs file for the libraries it finds. By default, dh_makeclilibs scans the .dll files in the package directories and writes the discovered compatibility data (major/minor, build, token) to "clilibs" files in the appropriate packages. However, if a file like debian/package.clilibs is found, this one will be installed and no scanning is performed. OPTIONS
-V, -Vdependancies --version-info, --version-info=dependancies By default, the clilibs file generated by this program does not make packages depend on any particular version of the package containing the assembly. It may be necessary for you to add some version dependency information to the clilibs file. If -V is specified with no dependency information, the current version of the package is plugged into a dependency that looks like "packagename (>= packageversion)". If -V is specified with parameters, the parameters can be used to specify the exact dependency information needed (be sure to include the package name). Beware of using -V without any parameters; this is a conservative setting that always ensures that other packages' shared library dependencies are at least as tight as they need to be, so that if the maintainer screws up then they won't break. The flip side is that packages might end up with dependencies that are too tight and so find it harder to be upgraded. -mminversion Like -V, but specifies only the version string, the package name comes from the package that is actually processed. This option is more flexible if you try to set a range of valid versions for different assembly packages coming from one source package. -lnextincompatible Specifies the (expected) version of this package when the compatibility to the current assemblies will break. -r An experimental option to automaticaly guess the next incompatible upstream version and insert them (like working with -l and -m options, see above). Do not expect the guessed values to be always correct - normally, the usualy assumed version string has the form generation.major.minor where versions with changes in "minor" are compatible and "major" versions break with compatibility. -Xitem, --exclude=item Exclude files that contain "item" anywhere in their filename or directory from being treated as shared libraries. --internal-mono Uses the Mono runtime in . (used for bootstrapping Mono packages) EXAMPLES
dh_makeclilibs Assuming this is a package named libfoobar0.9x-cil, generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil dh_makeclilibs -V Assuming the current version of the package is 0.93-3, generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil (>= 0.93-3) dh_makeclilibs -V 'libfoobar0.9x-cil (>= 0.92)' Generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil (>= 0.92) Assuming that your package creates libfoobar-cil and liblafasel-cil, which are compatible to 0.92 versions but the upstream is going to break compatibility in the next version, 0.94: dh_makeclilibs -m 0.92 -l 0.94 Generates clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar-cil (>= 0.92), libfoobar-cil (<< 0.94) and liblafasel 1.0.2345.0_23a12f34 liblafasel-cil (>= 0.92), liblafasel-cil (<< 0.94) SEE ALSO
debhelper(7) This program is a part of cli-common-dev. KNOWN BUGS
Will possibly not work correctly with DH_COMPAT levels 1 and 2. AUTHOR
Mirco Bauer <meebey@meebey.net>, Eduard Bloch <blade@debian.org>, inspired by dh_makeshlibs by Joey Hess <joeyh@debian.org> perl v5.14.2 2012-01-17 DH_MAKECLILIBS(1)
All times are GMT -4. The time now is 11:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy