01-22-2008
I tested it it was working for me, You try this one
awk -F ':' '{ if($0 ~ "^Report No") {fl=1; i=0;}
if(fl==1){data[i]=$0; i++;}
if($0 ~ "^BE NO:")
{
fname = "reprot_"$2".lis";
gsub(" ","",fname);
for(j=0;j<i;j++) print data[j] > fname;
fl=0;
}
else if(fl==0) print $0 > fname;
}' Report.txt
If this is also not working, let me know which flavour of unix ur working
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have the following nawk script:
nawk -F: '{ if($0 ~ "^Report No") {fl=1; i=0;}
if(fl==1){data=$0; i++}
if($0 ~ "^BE NO:")
{
fname = "reprot_"$2".lis";
gsub(" ","",fname);
for(j=0;j<i;j++) print data > fname;
fl=0;
}
else if(fl==0) print $0 > fname;
}' filename
When I try to apply... (1 Reply)
Discussion started by: raychu65
1 Replies
2. Shell Programming and Scripting
Hi friends,
I have data in flat file as following, first filed is the customer number. We have almost 50-100 customers in the system
100 ABC A123
100 BVC D234
100 BNC N324
200 CBC A122
200 AVC D294
200 HNC N324
300 GBC A173
300 FVC D234
300 DNC N344
I want to split the file and... (5 Replies)
Discussion started by: monicasgupta
5 Replies
3. Shell Programming and Scripting
Hi
I have a big verilog file with multiple modules. Each module begin with the code word 'module <module-name>(ports,...)'
and end with the
'endmodule' keyword.
Could you please suggest the best way to split each of these modules into multiple files?
Thank you for the help.
Example of... (7 Replies)
Discussion started by: return_user
7 Replies
4. UNIX for Advanced & Expert Users
Hello,
i have a very big file that has more then 80 MBytes (100MBytes). So with my CVS Application I cannot commit this file (too Big) because it must have < 80 MBytes.
How can I split this file into two others files, i think the AIX Unix command :
split -b can do that, buit how is the right... (2 Replies)
Discussion started by: steiner
2 Replies
5. Shell Programming and Scripting
Hi friends..
We have urgent requirement.We need to split the big xml having multiple orders into multiple xmls
having each order in each xml.
For Example
In input XMl will be in following format with multiple line orders..
<OrderDetail BillToKey="20100805337" Createuserid="CreateGuestOrder"... (8 Replies)
Discussion started by: dprakash
8 Replies
6. Shell Programming and Scripting
I have a requirement to split a huge file to smaller text files based on first four characters which look like
ABCD
1234
DFGH
RREX
:
:
:
:
:
0000
Each of these records are OF EQUAL bytes with a different internal layout based on the above first digit identifier..
Any help to start... (5 Replies)
Discussion started by: etldev
5 Replies
7. HP-UX
Hi HP-admins,
I have 120GB file on HP-UX and need to split to 4GB pieces and join them on Windows.
As I don't want to use zipsplit, tried to use split command and join on windows using "copy /b" but it doesn't work (It merges and creates new file but file is corrupt)
What is the correct... (6 Replies)
Discussion started by: prvnrk
6 Replies
8. Shell Programming and Scripting
this thread is a continuation from previous thread
https://www.unix.com/shell-programming-and-scripting/223901-split-big-file-into-multiple-files-based-first-four-characters.html
..I am using awk to split file and I have a syntax error while executing the below code
I am using AIX 7.2... (4 Replies)
Discussion started by: etldev
4 Replies
9. Shell Programming and Scripting
HI
I want to split file base on tag name.
I have few header and footer on file
<?xml version="1.33" encing="UTF-8"?>
<bulkCmConfigDataFile"
<xn:SubNetwork id="ONRM_ROOT">
<xn:MeContext id="PPP04156">
... (4 Replies)
Discussion started by: pareshkp
4 Replies
10. Solaris
Gents
Actually I have question and i need your support.
I have this NAS file system mounted as /coresys has size of 7 TB
I need to Split this file system into several file systems as mount points I mean how to can I Split it professionally to different NAS mount points how to can I decide... (2 Replies)
Discussion started by: AbuAliiiiiiiiii
2 Replies
sbig5(5) File Formats Manual sbig5(5)
NAME
sbig5 - A character encoding system (codeset) for Traditional Chinese
DESCRIPTION
The Shift Big-5 (sbig5) codeset is a variant of the Big-5 codeset (see big5(5)). The only difference between these codesets is that the
second byte of some Big-5 characters are mapped to different values in the Shift Big-5 codeset. The remapping is done to avoid having some
metacharacters like *, which has special meaning to UNIX commands, in the second byte of a 2-byte Big-5 character.
The mappings of Big-5 characters to Shift Big-5 characters are as follows:
------------------------------------------------------------------------
Big-5 (2nd Character Symbol Shift Big-5 (2nd Character Symbol
byte) byte)
------------------------------------------------------------------------
40 @ 30 0
5B [ 31 1
5C 32 2
5D ] 33 3
5E ^ 34 4
5F - 35 5
60 ` 36 6
7B { 37 7
7C | 38 8
7D } 39 9
7E ~ 9F nil
------------------------------------------------------------------------
The sbig5 codeset is not supported by a locale but only through codeset conversion.
Codeset Conversion
The following codeset converter pairs are available for converting Traditional Chinese characters between sbig5 and other encoding formats.
Refer to iconv_intro(5) for an introduction to codeset conversion. For more information about the other codeset for which sbig5 is the
input or output, see the reference page specified in the list item. big5_sbig5, sbig5_big5
Converting from and to the Big-5 codeset: big5(5).
Note that Big-5 encoding is equivalent to the Microsoft code-page format used on PCs for Traditional Chinese. Therefore, you can use
these converters to convert Traditional Chinese between PC code-page format and Shift Big-5 encoding. eucTW_sbig5, sbig5_eucTW
Converting from and to Taiwanese Extended UNIX Code: eucTW(5).
SEE ALSO
Commands: locale(1)
Others: ascii(5), big5(5), Chinese(5), code_page(5), dechanyu(5), dechanzi(5), eucTW(5), GBK(5), i18n_intro(5), i18n_printing(5),
iconv_intro(5), l10n_intro(5), telecode(5)
sbig5(5)