Sponsored Content
Top Forums Shell Programming and Scripting Splitting the files via shell script Post 302437491 by rdcwayx on Thursday 15th of July 2010 08:23:41 AM
Old 07-15-2010
Some tips for you.

If you can't fix the location of pharmcyid, are there any other way that we can find it?

Code:
4)The location of pharmcyid in each input flatfile varies according to the source table structure.

If the pharmcyid is always at column 1. You can use below code to generate the data files by pharmcyid.

Code:
awk '{print > toupper($1) "_" FILENAME}' *.dat

For example, from your sample file, you will get three files after run the command.

Code:
A123_ODS_ADT_20100731_000001.dat
C123_ODS_ADT_20100731_000001.dat
B123_ODS_ADT_20100731_000001.dat

So you can use cat command to combine all datas with same pharmcyid .

Code:
cat A123*20100731*.date > A123_ODS_ADT.dat

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

splitting the files

Hi, I'am using HP-UX.I have a input file which has 102 drop statements in it.I'am using csplit to split the files.The upper limit is 99 only.I'am using the -n 102 option.It says "suffix size not vaild".Any suggestions how to do it using csplit? Thanx in advance, sounder. (1 Reply)
Discussion started by: sounder123
1 Replies

2. UNIX for Advanced & Expert Users

splitting the files

Hi, How can i split the big file by the lines?. For eg. I wanna split the file from the line 140 to 1700. (9 Replies)
Discussion started by: sharif
9 Replies

3. Shell Programming and Scripting

Splitting input files into multiple files through AWK command

Hi, I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below for file in *.txt do grep -i -h "value1|value2" $file > $file; done. My requirment is more input values needs to be given in grep; let us say 50... (3 Replies)
Discussion started by: arund_01
3 Replies

4. UNIX for Dummies Questions & Answers

splitting shell window

hi is it possible to split the shell window in two or more parts like split command vi? i am using putty as telnet client. (2 Replies)
Discussion started by: ilayans
2 Replies

5. Shell Programming and Scripting

Help with shell script - splitting

Hi, I need to split the file lines in below format as. Input file : Sample.txt <Rule expression="DeliverToCompID IS NULL" invert="true"> <Rule field="PossDupFlag" value="Y" > <Rule expression="OrdStatus = '2' AND OrigClOrdID IS NULL"> Output... (5 Replies)
Discussion started by: manosubsulo
5 Replies

6. Shell Programming and Scripting

Splitting files

Hello all I have a file which has around 80 million records, I want to split it to 12 equal files, I tried using the split command but it is allowing me to split according to number of lines or by size. Is there a way i can split the file into 12 files without worrying about the number of lines... (7 Replies)
Discussion started by: Sri3001
7 Replies

7. Shell Programming and Scripting

Splitting files into 100 files with field value

I want a script to split my file upon the last field (15) As file A,b,c,.......,01 C,v,n,.......,02 C,r,v,........,01 F,s,a,........,03 X,y,d,........,99 To make output 01.txt A,b,c,.......,01 C,r,v,........,01 02.txt C,v,n,.......,02 (12 Replies)
Discussion started by: teefa
12 Replies

8. Shell Programming and Scripting

Splitting a file and creating new files using Perl script

Hi All, I am new to Scripting language. I want to split a file and create several subfiles using Perl script. Example : File format : Sourcename ID Date Nbr SU IMYFDJ 9/17/2012 5552159976555 SU BWZMIG 9/14/2012 1952257857887 AR PEHQDF 11/26/2012 ... (13 Replies)
Discussion started by: Deepak9870
13 Replies

9. Shell Programming and Scripting

Script for splitting file of records into multiple files

Hello I have a file of following format HDR 1234 abc qwerty abc def ghi jkl HDR 4567 xyz qwerty abc def ghi jkl HDR 890 mno qwerty abc def ghi jkl HDR 1234 abc qwerty abc def ghi jkl HDR 1234 abc qwerty abc def ghi jkl -Need to split this into multiple files based on tag... (8 Replies)
Discussion started by: wincrazy
8 Replies

10. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies
PGMTOIMGV(1)						      General Commands Manual						      PGMTOIMGV(1)

NAME
pgmtoimgv - Portable Graymap to Pilot Image Viewer converter, version 2.0. SYNOPSIS
pgmtoimgv [-h] [-v] [-4] [-t title] [-n notefile] [-{c|m|u}] [in [out]] DESCRIPTION
pgmtoimgv is a simple filter for converting Portable Graymaps to grayscale Pilot Image Viewer pdb files. The input pgm file must use the following palette unless you specify the -4 switch: P3 4 1 255 0 0 0 85 85 85 170 170 170 255 255 255 if you specify -4, then your grayscale image must use this palette: P3 16 1 255 0 0 0 17 17 17 34 34 34 51 51 51 68 68 68 85 85 85 102 102 102 119 119 119 136 136 136 153 153 153 170 170 170 187 187 187 204 204 204 221 221 221 238 238 238 255 255 255 If your PGM file doesn't use one of these palettes, use ppmquant(1) to convert your palette. If an image's width is not a multiple of 16 pixels, enough extra white pixels will be added at the right side to ensure alignment. Images will be padded, with white pixels, to a width and height of 160 if needed. OPTIONS
-h Display a short summary of the command line options and exit. -v Display the version and exit. -4 Use 4 bit grayscale (16 shades of gray). -t title Specify the title of the image (up to 31 characters). -n notefile Specify the note file. No note is attached to the image by default. -c Produce a compressed image. -m Produce a compressed image if it is smaller than the uncompressed version. This is the default compression mode. -u Produce an uncompressed image. in The input file. The default is the standard input. out The output file. The default is the standard output. SEE ALSO
imgvinfo(1), imgvtopnm(1), imgvview(1), pbmtoimgv(1), ppmimgvquant(1), pbm(5), pgm(5). BUGS
Bug reports should be sent to Eric A. Howe (mu@trends.net). LICENSE
Copyright (C) 1997,1998 Eric A. Howe <http://www.trends.net/~mu>. This program 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 MER- CHANTABILITY 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; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Sept 1997 PGMTOIMGV(1)
All times are GMT -4. The time now is 02:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy