Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Split single record to multiple records Post 302601979 by bab.galary on Saturday 25th of February 2012 11:14:42 AM
Old 02-25-2012
Split single record to multiple records

Hi Friends,
source
....
col1,col2,col3
a,b,1;2;3

here colom delimeter is comma(,).
here we dont know what is the max length of col3 means now we have 1;2;3 next time i will receive 1;2;3;4;5;etc...

required output
..............
col1,col2,col3
a,b,1
a,b,2
a,b,3


please give me idea how to solve this problem.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to split multiple records file in n files

Hello, Each record has a lenght of 7 characters I have 2 types of records 010 and 011 There is no character of end of line. For example my file is like that : 010hello 010bonjour011both 011sisters I would like to have 2 files 010.txt (2 records) hello bonjour and ... (1 Reply)
Discussion started by: jeuffeu
1 Replies

2. Shell Programming and Scripting

Parsing record into multiple records in Shell Script

Hi, I am trying to parse a very long record in a text file into multiple records by checking ADD, DELETE, or MODIFY field value in a shell script. Input # File name xyz.txt ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678 Output ADD|N000|8015662| DELETE|N001|9915662|... (8 Replies)
Discussion started by: naveed
8 Replies

3. Shell Programming and Scripting

Multiple records based on ';' in the record

Hi All, I have a *.csv files in a die /pro/lif/dow, (pipe delimiter file), these files are having 8 columns and 6 column(CDR_LOGIC) records are populated as below, I need to incorporate the below logic in all the *.csv files. 11||:ColumnA||:ColumnB 123||:ColumnA IIF(:ColumnA = :ColumnC then... (6 Replies)
Discussion started by: shruthidwh
6 Replies

4. Shell Programming and Scripting

Split a single record to multiple records & add folder name to each line

Hi Gurus, I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name. I have a dir. in which... (20 Replies)
Discussion started by: ram2581
20 Replies

5. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

6. Shell Programming and Scripting

Split records into multiple records

Hi All, I am trying to split a record into multiple records based on a value. Input.txt "A",1,0,10 "B",2,0,10,15,20 "C",3,11,14,16,19,21,23 "D",1,0,5 My desired output is: "A",1,0,10 "B",2,0,10 "B",2,15,20 "C",3,11,14 "C",3,16,19 "C",3,21,23 (4 Replies)
Discussion started by: kmsekhar
4 Replies

7. Shell Programming and Scripting

Splitting record into multiple records by appending values from an input field (AWK)

Hello, For the input file, I am trying to split those records which have multiple values seperated by '|' in the last input field, into multiple records and each record corresponds to the common input fields + one of the value from the last field. I was trying with an example on this forum... (4 Replies)
Discussion started by: imtiaz99
4 Replies

8. Shell Programming and Scripting

Multiple Records from 1 Record

I need to make one record to multiple records based on occurence column in the record and change the date.For example below first record has 5 ,so need to create 5 records from one and change the date to 5 months.Occurence can be any number. I am unable to come with a script.Can some one help ... (5 Replies)
Discussion started by: traininfa
5 Replies

9. Shell Programming and Scripting

Split a large file in n records and skip a particular record

Hello All, I have a large file, more than 50,000 lines, and I want to split it in even 5000 records. Which I can do using sed '1d;$d;' <filename> | awk 'NR%5000==1{x="F"++i;}{print > x}'Now I need to add one more condition that is not to break the file at 5000th record if the 5000th record... (20 Replies)
Discussion started by: ibmtech
20 Replies

10. Shell Programming and Scripting

How to split one record to multiple records?

Hi, I have one tab delimited file which is having multiple store_ids in first column seprated by pipe.I want to split the file on the basis of store_id(separating 1st record in to 2 records ). I tried some more options like below with using split,awk etc ,But not able to get proper output. can... (1 Reply)
Discussion started by: jaggy
1 Replies
FP2HDF(1)						      General Commands Manual							 FP2HDF(1)

NAME
fp2hdf - convert floating point data to HDF SYNOPSIS
fp2hdf -h[elp] fp2hdf infile [infile...] -o[utfile outfile] [-r[aster] [ras_options...]] [-f[loat]] DESCRIPTION
fp2hdf converts floating point data to HDF Scientific Data Set (SDS) and/or 8-bit Raster Image Set (RIS8) format, storing the results in an HDF file. The image data can be scaled about a mean value. Input file(s) contain a single two-dimensional or three-dimensional floating point array in either ASCII text, native floating point, or HDF SDS format. If an HDF file is used for input, it must contain an SDS. The SDS need only contain a dimension record and the data, but if it also contains maximum and minimum values and/or scales for each axis, these will be used. If the input format is ASCII text or native floating point, see "Notes" below on how it must be organized. OPTIONS
-h[elp] Print a helpful summary of usage, and exit. -o[utfile] outfile Data from one or more input files are stored as one or more data sets and/or images in one HDF output file, outfile. -r[aster] Store output as a raster image set in the output file -f[loat] Store output as a scientific data set in the the output file. This is the default if the "-r" option is not specified. ras_opts: -e[xpand] horiz vert [depth] Expand float data via pixel replication to produce the image(s). horiz and vert give the horizontal and vertical resolution of the image(s) to be produced; and optionally, depth gives the number of images or depth planes (for 3D input data). -i[nterp] horiz vert [depth] Apply bilinear, or trilinear, interpolation to the float data to produce the image(s). horiz, vert, and depth must be greater than or equal to the dimensions of the original dataset. -p[alfile] palfile Store the palette with the image. Get the palette from palfile; which may be an HDF file containing a palette, or a file containing a raw palette. -m[ean] mean If a floating point mean value is given, the image will be scaled about the mean. The new extremes (newmax and newmin), as given by: newmax = mean + max(abs(max-mean), abs(mean-min)) newmin = mean - max(abs(max-mean), abs(mean-min)) will be equidistant from the mean value. If no mean value is given, then the mean will be: 0.5 * (max + min) INPUT
If the input file format is ASCII text or native floating point, it must have the following input fields: format nplanes nrows ncols max_value min_value [plane1 plane2 plane3 ...] row1 row2 row3 ... col1 col2 col3 ... data1 data2 data3 ... ... Where: format Format designator ("TEXT", "FP32" or "FP64"). nplanes Dimension of the depth axis ("1" for 2D input). nrows Dimension of the vertical axis. ncols Dimension of the horizontal axis. max_value Maximum data value. min_value Minimum data value. plane1, plane2, plane3, ... Scales for depth axis. row1, row2, row3, ... Scales for the vertical axis. col1, col2, col3, ... Scales for the horizontal axis. data1, data2, data3, ... The data ordered by rows, left to right and top to bottom; then optionally, ordered by planes, front to back. For FP32 and FP64 input format, format, nplanes, nrows, ncols, and nplanes are native integers; where format is the integer repre- sentation of the appropriate 4-character string (0x46503332 for "FP32" and 0x46503634 for "FP64"). The remaining input fields are composed of native 32-bit floating point values for FP32 input format, or native 64-bit floating point values for FP64 input format. EXAMPLE
Convert floating point data in "f1.txt" to SDS format, and store it as an SDS in HDF file "o1": fp2hdf f1.txt -o o1 Convert floating point data in "f2.hdf" to 8-bit raster format, and store it as an RIS8 in HDF file "o2": fp2hdf f2.hdf -o o2 -r Convert floating point data in "f3.bin" to 8-bit raster format and SDS format, and store both the RIS8 and the SDS in HDF file "o3": fp2hdf f3.bin -o o3 -r -f Convert floating point data in "f4" to a 500x600 raster image, and store the RIS8 in HDF file "o4". Also store a palette from "palfile" with the image: fp2hdf f4 -o o4 -r -e 500 600 -p palfile Convert floating point data in "f5" to 200 planes of 500x600 raster images, and store the RIS8 in HDF file "o5". Also scale the image data so that it is centered about a mean value of 10.0: fp2hdf f5 -o o5 -r -i 500 600 200 -m 10.0 SEE ALSO
hdf(5) October 30, 1999 FP2HDF(1)
All times are GMT -4. The time now is 07:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy