Sponsored Content
Top Forums Shell Programming and Scripting Splitting textfile based on pattern and name new file after pattern Post 302895221 by RudiC on Saturday 29th of March 2014 05:28:27 PM
Old 03-29-2014
mjf's solution is close, but it doesn't deal with those <empty><empty><empty> lines. Please tell us
- how fields are separated, esp. that <empty><empty><empty> ones
- what does <empty> mean
You might want to post a (short) binary listing of a sample file (use od or hexdump).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print a pattern between the xml tags based on a search pattern

Hi all, I am trying to extract the values ( text between the xml tags) based on the Order Number. here is the sample input <?xml version="1.0" encoding="UTF-8"?> <NJCustomer> <Header> <MessageIdentifier>Y504173382</MessageIdentifier> ... (13 Replies)
Discussion started by: oky
13 Replies

2. Shell Programming and Scripting

Splitting large file into multiple files in unix based on pattern

I need to write a shell script for below scenario My input file has data in format: qwerty0101TWE 12345 01022005 01022005 datainala alanfernanded 26 qwerty0101mXZ 12349 01022005 06022008 datainalb johngalilo 28 qwerty0101TWE 12342 01022005 07022009 datainalc hitalbert 43 qwerty0101CFG 12345... (19 Replies)
Discussion started by: jimmy12
19 Replies

3. Shell Programming and Scripting

Problem with splitting large file based on pattern

Hi Experts, I have to split huge file based on the pattern to create smaller files. The pattern which is expected in the file is: Master..... First... second.... second... third.. third... Master... First.. second... third... Master... First... second.. second.. second..... (2 Replies)
Discussion started by: saisanthi
2 Replies

4. Shell Programming and Scripting

Splitting file based on pattern and first character

I have a file as below pema.txt s2dhshfu dshfkdjh dshfd rjhfjhflhflhvflxhvlxhvx vlvhx sfjhldhfdjhldjhjhjdhjhjxhjhxjxh sjfdhdhfldhlghldhflhflhfhldfhlsh rjsdjh#error occured# skjfhhfdkhfkdhbvfkdhvkjhfvkhf sjkdfhdjfh#error occured# my requirement is to create 3 files frm the... (8 Replies)
Discussion started by: pema.yozer
8 Replies

5. UNIX for Dummies Questions & Answers

Find next line based on pattern, if it is similar pattern skip it

Hi, I am able to get next line if it is matching a particular pattern. But i need a way to skip if next line also matches same pattern.. For example: No Records No Records Records found got it Records found Now i want to find 'Records found' after 'No Records' pattern matches.. ... (5 Replies)
Discussion started by: nagpa531
5 Replies

6. Shell Programming and Scripting

Split the file based on pattern

Hi , I have huge files around 400 mb, which has clob data and have diffeent scenarios: I am trying to pass scenario number as parameter and and get required modified file based on the scenario number and criteria. Scenario 1: file name : scenario_1.txt ... (2 Replies)
Discussion started by: sol_nov
2 Replies

7. Shell Programming and Scripting

Splitting a file into 4 files containing the same name pattern

Hello, I have one file which is in size around 20 MB , wanted to split up into four files of each size of 5 MB. ABCD_XYZ_20130302223203.xml. Requirement is that to write script which should do as : first three file should be of size 5 MB each, the fourth one content should be in the last... (8 Replies)
Discussion started by: ajju
8 Replies

8. UNIX for Advanced & Expert Users

Split one file to many based on pattern

Hello All, I have records in a file in a pattern A,B,B,B,B,K,A,B,B,K Is there any command or simple logic I can pull out records into multiple files based on A record? I want output as File1: A,B,B,B,B,K File2: A,B,B,K (9 Replies)
Discussion started by: deal1dealer
9 Replies

9. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

10. UNIX for Beginners Questions & Answers

Splitting a file based on a pattern

Hi All, I am having a problem. I tried to extract the chunk of data and tried to fix I am not able to. Any help please Basically I need to remove the for , values after K, this is how it is now A,, B, C,C, D,D, 12/04/10,12/04/10, K,1,1,1,1,0,3.0, K,1,1,1,2,0,4.0,... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies
deb-changes(5)							    dpkg suite							    deb-changes(5)

NAME
       deb-changes - Debian changes file format

SYNOPSIS
       filename.changes

DESCRIPTION
       Each Debian upload is composed of a .changes control file, which contains a number of fields.  Each field begins with a tag, such as Source
       or Binary (case insensitive), followed by a colon, and the body of the field.  Fields are delimited only by field tags.	 In  other  words,
       field  text  may  be  multiple  lines in length, but the installation tools will generally join lines when processing the body of the field
       (except in case of the multiline fields Description, Changes, Files, Checksums-Sha1 and Checksums-Sha256, see below).

       The control data might be enclosed in an OpenPGP ASCII Armored signature, as specified in RFC4880.

FIELDS
       Format: format-version (required)
	      The value of this field declares the format version of the file.	The syntax of the field value is a version number with a major and
	      minor  component.  Backward incompatible changes to the format will bump the major version, and backward compatible changes (such as
	      field additions) will bump the minor version.  The current format version is 1.8.

       Date: release-date (required)
	      The date the package was built or last edited.  It must be in the same format as the date in a deb-changelog(5) entry.

	      The value of this field is usually extracted from the debian/changelog file.

       Source: source-name [(source-version)] (required)
	      The name of the source package.  If the source version differs from the binary version, then the source-name will be followed  by  a
	      source-version in parenthesis.  This can happen when the upload is a binary-only non-maintainer upload.

       Binary: binary-package-list (required)
	      This folded field is a space-separated list of binary packages to upload.

       Architecture: arch-list
	      Lists the architectures of the files currently being uploaded.  Common architectures are amd64, armel, i386, etc.  Note that the all
	      value is meant for packages that are architecture independent.  If the source for the package is also being  uploaded,  the  special
	      entry source is also present.  Architecture wildcards must never be present in the list.

       Version: version-string (required)
	      Typically,  this	is the original package's version number in whatever form the program's author uses.  It may also include a Debian
	      revision number (for non-native packages).  The exact format and sorting algorithm are described in deb-version(7).

       Distribution: distributions (required)
	      Lists one or more space-separated distributions where this version should be installed when it is uploaded to the archive.

       Urgency: urgency (recommended)
	      The urgency of the upload.  The currently known values, in increasing order  of  urgency,  are:  low,  medium,  high,  critical  and
	      emergency.

       Maintainer: fullname-email (required)
	      Should  be  in the format "Joe Bloggs <jbloggs@example.org>", and is typically the person who created the package, as opposed to the
	      author of the software that was packaged.

       Changed-By: fullname-email
	      Should be in the format "Joe Bloggs <jbloggs@example.org>", and is typically the person who prepared the package	changes  for  this
	      release.

       Description: (recommended)
	binary-package-name - binary-package-summary
	      This  multiline  field  contains a list of binary package names followed by a space, a dash ('-') and their possibly truncated short
	      descriptions.

       Closes: bug-number-list
	      A space-separated list of bug report numbers that have been resolved with this upload.  The distribution archive software might  use
	      this field to automatically close the referred bug numbers in the distribution bug tracking system.

       Binary-Only: yes
	      This field denotes that the upload is a binary-only non-maintainer build.  It originates from the binary-only=yes key/value from the
	      changelog matadata entry.

       Built-For-Profiles: profile-list
	      This field specifies a whitespace separated list of build profiles that this upload was built with.

       Changes: (required)
	changelog-entries
	      This multiline field contains the concatenated text of all changelog entries that are part of the upload.   To  make  this  a  valid
	      multiline field empty lines are replaced with a single full stop ('.') and all lines are indented by one space character.  The exact
	      content depends on the changelog format.

       Files: (required)
	md5sum size section priority filename
	      This multiline field contains a list of files with an md5sum, size, section and priority for each one.

	      The first line of the field value (the part on the same line as the field name followed by a colon) is always empty.  The content of
	      the field is expressed as continuation lines, one line per file.	Each line consists of space-separated entries describing the file:
	      the md5sum, the file size, the file section, the file priority, and the file name.

	      This field lists all files that make up the upload.  The list of files in this field must match the  list  of  files  in	the  other
	      related Checksums fields.

       Checksums-Sha1: (required)
       Checksums-Sha256: (required)
	checksum size filename
	      These  multiline fields contain a list of files with a checksum and size for each one.  These fields have the same syntax and differ
	      only in the checksum algorithm used: SHA-1 for Checksums-Sha1 and SHA-256 for Checksums-Sha256.

	      The first line of the field value (the part on the same line as the field name followed by a colon) is always empty.  The content of
	      the field is expressed as continuation lines, one line per file.	Each line consists of space-separated entries describing the file:
	      the checksum, the file size, and the file name.

	      These fields list all files that make up the upload.  The list of files in these fields must match the list of files  in	the  Files
	      field and the other related Checksums fields.

BUGS
       The  Files  field  is  inconsistent  with  the  other  Checksums  fields.   The	Change-By and Maintainer fields have confusing names.  The
       Distribution field contains information about what is commonly referred to as a suite.

SEE ALSO
       deb-src-control(5), deb-version(7).

1.19.0.5							    2018-04-16							    deb-changes(5)
All times are GMT -4. The time now is 06:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy