06-03-2013
How can I get certain records from this file format?
I have a file named: learn.999 that has the following format where each record is separated by ^M as follows:
6232|12341|8144836458|20110719132528|0^M4124|5963|3022610000|20011023205510|0^M7606|10858|3022560001 |20071012222359|0^M7606|10257|3022560002|20061205202926|0^M6664|7208|7247129469|20020927162412|0^M41 51|10918|4237949999|20071128163443|0^M9211|1487|7574682269|19980526145925|0^M0661|5553|4346450000|20 010521202205|0^M6232|12345|8144836476|20110719132528|0^M418C|10800|8149080000|20071001161928|0^M6232 |8833|4438648920|20040205225704|0^M6940|9939|2762180272|20051031165254|0^M7125|11379|7179166000|2009 0622152947|0^M6664|11714|8144189179|20100324182655|0^M9211|5562|8042149046|20010531173604|0^M6214|70 10|3022499476|20020919201646|0^M9211|3935|8564689999|19990610130025|0^M9211|4845|8144792051
I need to pick and write the first 1,000,000 records out of that file into another file named learn.top1m and keeping the same format however, without having a ^M at the end of the last record?
Thanks
Last edited by Scott; 06-03-2013 at 02:38 PM..
Reason: Moved thread - has nothing to do with Redhat
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies
2. UNIX for Dummies Questions & Answers
Hi
I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source .
Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies
3. UNIX for Dummies Questions & Answers
file_in_1:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
25 26 27 28
29 30 31 32
file_in_2:
9 10 11 12
21 22 23 24
1 2 3 4
17 18 19 20
file_out: (5 Replies)
Discussion started by: kenneth.mcbride
5 Replies
4. Shell Programming and Scripting
Data on my input file :
Ac1n1s1c2n2s2XPd1r1e1t1d2r2e2t2d3r3e3t3d4r4e4t4RT
Bh1k1p1h2k2p2NTq1y1f1m1q2y2f2m2q3y3f3m3q4y4f4m4ZN
and i want the output to be:
Ac1n1s1XPd1r1e1t1RT
Ac1n1s1XPd2r2e2t2RT
Ac1n1s1XPd3r3e3t3RT
Ac1n1s1XPd4r4e4t4RT
Ac2n2s2XPd1r1e1t1RT
Ac2n2s2XPd2r2e2t2RT... (6 Replies)
Discussion started by: rlmadhav
6 Replies
5. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
6. Shell Programming and Scripting
Hi,
I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix.
My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies
7. Shell Programming and Scripting
I have 2 files
"File 1" is delimited by ";" and "File 2" is delimited by "|".
File 1 below (3 record shown):
Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones
Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull
Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
Discussion started by: vestport
2 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
I have a input file say record.txt
hostname IP_address Port_No Version
A 10.10.10.1 80 6.02
B 10.10.10.2 81 6.03
C 10.10.10.3 82 6.04
row 1 has 4 field headings : hostname, IP_address, Port_No and Version.
and from 2nd row onwards the actual records start.
now i need to... (2 Replies)
Discussion started by: PranavEcstasy
2 Replies
9. Shell Programming and Scripting
Hello Experts,
Below is the record i have:
sample data attached
I want this record of each row to be in single line and there are multiple rowise unixtime mentioned e.g 11996327 , This needs to be converted to Human readdable data and time from multiple rows
Can you help me , it will be... (10 Replies)
Discussion started by: manishK
10 Replies
10. Shell Programming and Scripting
Hi I am new to shell programming in unix
Please if I can provide help.
I have a file structure of a header record and "N" detail records.
The header record will be the total number of detail records
I need to split the file in 2:
One for the header
Another for all detail records
Could... (1 Reply)
Discussion started by: jamcogar
1 Replies
LEARN ABOUT DEBIAN
named-journalprint
NAMED-JOURNALPRINT(8) BIND9 NAMED-JOURNALPRINT(8)
NAME
named-journalprint - print zone journal in human-readable form
SYNOPSIS
named-journalprint {journal}
DESCRIPTION
named-journalprint prints the contents of a zone journal file in a human-readable form.
Journal files are automatically created by named when changes are made to dynamic zones (e.g., by nsupdate). They record each addition or
deletion of a resource record, in binary format, allowing the changes to be re-applied to the zone when the server is restarted after a
shutdown or crash. By default, the name of the journal file is formed by appending the extension .jnl to the name of the corresponding zone
file.
named-journalprint converts the contents of a given journal file into a human-readable text format. Each line begins with "add" or "del",
to indicate whether the record was added or deleted, and continues with the resource record in master-file format.
SEE ALSO
named(8), nsupdate(8), BIND 9 Administrator Reference Manual.
AUTHOR
Internet Systems Consortium
COPYRIGHT
Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
BIND9 Feb 18, 2009 NAMED-JOURNALPRINT(8)