The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to view the contents of .gz file without extracting the file? amitkhiare Shell Programming and Scripting 10 12-18-2008 05:59 AM
Splitting a file based on record sin another file er_ashu UNIX for Dummies Questions & Answers 7 05-15-2008 11:06 PM
Splitting a file based on the records in another file er_ashu Shell Programming and Scripting 2 05-12-2008 04:34 PM
Help needed in removing intermediate segments from a pipe delimited segment file naren_0101bits Shell Programming and Scripting 3 12-03-2007 11:54 AM
Extracting data from text file based on configuration set in config file suparnbector Shell Programming and Scripting 3 08-10-2007 02:25 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-13-2006
ozgurgul ozgurgul is offline
Registered User
  
 

Join Date: Sep 2006
Location: Prague, CZ
Posts: 3
Question [Splitting file] Extracting group of segments from one file to others

Hi there,

I need to split one huge file into separate files if the condition is fulfilled according to that the position between 97 and 98 matches with “IT” at the segment MAS. There is no delimiter file is fix-width with varous line length.

Could you please help me how I do split the file into separate files like <filename>.[0-9][0-9][0-9].IT

BTW I meant as multiple segment messages in one file is something like that

Code:
MAS		NZ	-len 200-	(1st msg)
DOS 			-len 175-
TMP			-len 66-
CON			-len 388-
…
…
MAS		IT			(2nd msg)
DOS 
TMP
PTY
…
…
MAS		IN			(3rd msg)
DOS 
TMP
GDS
…
…

…
…
MAS		IT			(nth msg)
DOS 
TMP
…
…
According to the scenario, I have to create two new files for msg 2 and n and they will be kept in <filename>.001.IT and <filename>.00m.IT –m is the file count-
And file <filename>.001.IT looks like

Code:
MAS		IT			
DOS 
TMP
PTY
…
…

Thanks in advance,

Ciao
  #2 (permalink)  
Old 09-14-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
  
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
Sounds like a job for csplit.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0