Sponsored Content
Top Forums Shell Programming and Scripting Create multiple text file from a single text file on AIX Post 302372510 by Franklin52 on Wednesday 18th of November 2009 05:52:27 AM
Old 11-18-2009
After conversion the format you can try this:

Code:
awk '/A\/C NO. TYPE\/CCY :/{f=$(NF-1)}f{print > f}' unixfile


Explanation of the first command:

Code:
awk -F"[\./]" '/FILE =/{f=$(NF-1)}f{print > f}' file

Quote:
-F"[\./]" -> fieldseparator is "." or "/"

/FILE =/{f=$(NF-1)} -> if the line containes "FILE =" then the filename (variable f) = penultimate field

(NF-1) -> NF is the number of fields, $(NF-1) is the penultimate field

f{print > f} -> if f is not null print the entire line to the file f
With the explanation you should be able to customize the code if it doesn't give the desired result.
This User Gave Thanks to Franklin52 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep multiple text files in folder into 1 text file?

How do I use the grep command to take mutiple text files in a folder and make one huge text file out of them. I'm using Mac OS X and can not find a text tool that does it so I figured I'd resort to the BSD Unix CLI for a solution... there are 5,300 files that I want to write to one huge file so... (7 Replies)
Discussion started by: coppertone
7 Replies

2. Shell Programming and Scripting

Need to remove multiple text from a single file

Dear all, I have a file which have let us say records from A-Z. Now I want to remove multiple letter from this file using single command.. let us say I want to remove A,F,K,Y,U,P,B,S,D. I can use grep -v command but for this case i need to rerun the file several time i wana avoid using... (3 Replies)
Discussion started by: jojo123
3 Replies

3. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

4. Shell Programming and Scripting

Script to create a text file whose content is the text of another files

Hello everyone, I work under Ubuntu 11.10 (c-shell) I need a script to create a new text file whose content is the text of another text files that are in the directory $DIRMAIL at this moment. I will show you an example: - On the one hand, there is a directory $DIRMAIL where there are... (1 Reply)
Discussion started by: tenteyu
1 Replies

5. UNIX for Dummies Questions & Answers

How to grep multiple lines from a text file using another text file?

I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

6. UNIX for Dummies Questions & Answers

Changing text in multiple files, but with different text for each file

Hello, I have a situation where I want to change a line of text in multiple files, but the problem is that I want to change the text to something unique for each file. For example, let's say I have five files named bob.txt, joe.txt, john.txt, tom.txt, and zach.txt. Each of these files has a... (5 Replies)
Discussion started by: Scatterbrain26
5 Replies

7. Shell Programming and Scripting

Split a text file into multiple text files?

I have a text file with entries like 1186 5556 90844 7873 7722 12 7890.6 78.52 6679 3455 9867 1127 5642 ..N so many records like this. I want to split this file into multiple files like cluster1.txt, cluster2.txt, cluster3.txt, ..... clusterN.txt. (4 Replies)
Discussion started by: sammy777
4 Replies

8. UNIX for Dummies Questions & Answers

Pdftotext from multiple pdf files to a single text file

I have a directory having a number of pdf files. I want to convert all the files to text, stored in a single text file The following creates multiple text files ls *.pdf | xargs -n1 pdftotext (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

Create multiple files from single file based on row separator

Hello , Can anyone please help me to solve the below - Input.txt source table abc col1 char col2 number source table bcd col1 date col2 char output should be 2 files based on the row separator "source table" abc.txt col1 char (6 Replies)
Discussion started by: Pratik4891
6 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
ldns(3) 						     Library Functions Manual							   ldns(3)

NAME
ldns_rr_print, ldns_rdf_print, ldns_pkt_print, ldns_rr_list_print, ldns_resolver_print, ldns_zone_print- SYNOPSIS
#include <stdint.h> #include <stdbool.h> #include <ldns/ldns.h> void ldns_rr_print(FILE *output, const ldns_rr *rr); void ldns_rdf_print(FILE *output, const ldns_rdf *rdf); void ldns_pkt_print(FILE *output, const ldns_pkt *pkt); void ldns_rr_list_print(FILE *output, const ldns_rr_list *list); void ldns_resolver_print(FILE *output, const ldns_resolver *r); void ldns_zone_print(FILE *output, const ldns_zone *z); DESCRIPTION
ldns_rr_print() Prints the data in the resource record to the given file stream (in presentation format) output: the file stream to print to rr: the resource record to print Returns void ldns_rdf_print() Prints the data in the rdata field to the given file stream (in presentation format) output: the file stream to print to rdf: the rdata field to print Returns void ldns_pkt_print() Prints the data in the DNS packet to the given file stream (in presentation format) output: the file stream to print to pkt: the packet to print Returns void ldns_rr_list_print() print a rr_list to output output: the fd to print to list: the rr_list to print ldns_resolver_print() Print a resolver (in sofar that is possible) state to output. output: the fd to print to r: the resolver to print ldns_zone_print() Print a zone structure * to output. Note the SOA record is included in this output output: the fd to print to z: the zone to print AUTHOR
The ldns team at NLnet Labs. Which consists out of Jelte Jansen and Miek Gieben. REPORTING BUGS
Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at http://www.nlnetlabs.nl/bugs/index.html COPYRIGHT
Copyright (c) 2004 - 2006 NLnet Labs. Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
ldns_rr2str, ldns_rdf2str, ldns_pkt2str, ldns_rr_list2str, ldns_key2str. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. REMARKS
This manpage was automaticly generated from the ldns source code by use of Doxygen and some perl. 30 May 2006 ldns(3)
All times are GMT -4. The time now is 10:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy