Sponsored Content
Top Forums Shell Programming and Scripting split content and write to new record Post 302598401 by durden_tyler on Tuesday 14th of February 2012 10:14:01 AM
Old 02-14-2012
Code:
$
$ cat f59
a~b~c~value in ('3','4','5')~test2
x~y~val~value in ('0','1','2')~test2
p~q~r~value in ('1','2','3','4','5','6','7','8','9','0')~test3
j~k~l~value in ('7')~test4
$
$
$ perl -lne '/^((?:.*?~){3}).*\((.*?)\)(.*)/; ($x,$y)=($1,$3); map{s/\D//g;print $x,$_,$y}split/,/,$2' f59
a~b~c~3~test2
a~b~c~4~test2
a~b~c~5~test2
x~y~val~0~test2
x~y~val~1~test2
x~y~val~2~test2
p~q~r~1~test3
p~q~r~2~test3
p~q~r~3~test3
p~q~r~4~test3
p~q~r~5~test3
p~q~r~6~test3
p~q~r~7~test3
p~q~r~8~test3
p~q~r~9~test3
p~q~r~0~test3
j~k~l~7~test4
$
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a record

UNIX Scripting Hi I am trying to read a record and split it into multiple records My Record looks like this 1001A0010@B0010*&^0)C0012hgdj&6sD0020fhfri93kivmepi9 where UniqueID is 1001 segments are A,B,C,D length of each segment is 4 characters after the segment 0010 for A 0010 for B 0012... (5 Replies)
Discussion started by: pukars4u
5 Replies

2. Shell Programming and Scripting

How to split a file record

-Hi, I have a problem with parcing/spliting a file record into two parts and assigning the split parts to two viriables. The record is as follows: ftrn facc ttrd feed xref fsdb fcp ruldb csdb omom fordr ftxn fodb fsdc texc oxox reng ttrn ttxn fqdb ... (5 Replies)
Discussion started by: aoussenko
5 Replies

3. Shell Programming and Scripting

Split a record based on particular match

Hi , I have a requirement to split the record based on particular match using UNIX. Case1: Input Record : 10.44.48.63;"Personals/Dating;sports";1441 Output Records : 10.44.48.63;Personals/Dating;1441;Original 10.44.48.63;sports;1441;Dummy Case2: Input Record : ... (5 Replies)
Discussion started by: mksuneel
5 Replies

4. Shell Programming and Scripting

Record split.

I want to keep only records contain length is 10 other records should remove from my original file without redirecting to other output file. Source 1234567890 123456789011234 abcdefghil Expected Result 1234567890 abcdefghil (9 Replies)
Discussion started by: Jairaj
9 Replies

5. Shell Programming and Scripting

split record based on delimiter

Hi, My inputfile contains field separaer is ^. 12^inms^ 13^fakdks^ssk^s3 23^avsd^ 13^fakdks^ssk^a4 I wanted to print only 2 delimiter occurence i.e 12^inms^ 23^avsd^ (4 Replies)
Discussion started by: Jairaj
4 Replies

6. UNIX for Dummies Questions & Answers

split record without pattern

Hi , I have file with all records in one line, which needs to split it to have a fixed length.Am trying to execute the below script for the same FILENAME="$1" while line LINE do echo $LINE | awk 'BEGIN{n=1}{while(substr($0,n,10)){print substr($0,n,10);n+=10}}' done < $FILENAME it... (4 Replies)
Discussion started by: nishantrk
4 Replies

7. Shell Programming and Scripting

Help with keep the record with share content

Input file: 1234 USA date 3421 USA date 3421 USA content 1234 USA1 date 34 USA1 content 1234 USA2 Sun 34 USA2 Sun 43 USA2 Sun 345 USA2 date 435 USA2 date1 Output file: 1234 USA date 3421 USA date 1234 USA1 date 1234 USA2 Sun 34 USA2 Sun 43 USA2 Sun (0 Replies)
Discussion started by: perl_beginner
0 Replies

8. Shell Programming and Scripting

Need to split record

Hi All, Need help in writing a shell script for the below requirement: i/p: 123456789 o/p: 123 456 789 Req: one record should be split into multiple based on the length ( after every third character it should be moved into next line) Thanks in Advance (14 Replies)
Discussion started by: HemaV
14 Replies

9. 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

10. UNIX for Advanced & Expert Users

How to split large file with different record delimiter?

Hi, I have received a file which is 20 GB. We would like to split the file into 4 equal parts and process it to avoid memory issues. If the record delimiter is unix new line, I could use split command either with option l or b. The problem is that the line terminator is |##| How to use... (5 Replies)
Discussion started by: Ravi.K
5 Replies
ECACCESS-ASSOCIATION-DELETE(1p) 			User Contributed Perl Documentation			   ECACCESS-ASSOCIATION-DELETE(1p)

NAME
ecaccess-association-delete - Delete Association SYNOPSIS
ecaccess-association-delete -version|-help|-manual ecaccess-association-delete [-debug] [-gateway name] association-name DESCRIPTION
Allow deleting an ECtrans Association. Once deleted the Association can not be retrieved. The History associated with this Association will also be removed from the ECaccess Gateway Database. ARGUMENTS
association-name The name of the Association to delete. OPTIONS
-gateway name This is the name of the ECaccess Gateway where the Association is installed. It is by default the Gateway you are connected to. In order to get the name of your current Gateway you can use the ecaccess-gateway-name command. When using the commands at ECMWF the default Gateway is always "ecaccess.ecmwf.int". -version Display version number and exits. -help Print a brief help message and exits. -manual Prints the manual page and exits. -debug Display the SOAP messages exchanged. EXAMPLES
ecaccess-association-delete -gateway ecaccess.ecmwf.int test Remove the test Association on the ecaccess.ecmwf.int Gateway. ecaccess-association-delete test2 Remove the test2 Association on the default Gateway. SEE ALSO
ecaccess-association-get, ecaccess-association-list, ecaccess-association-protocol, ecaccess-association-put and ecaccess. perl v5.14.2 2012-04-16 ECACCESS-ASSOCIATION-DELETE(1p)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy