10-26-2006
Thanks igor for the solution., but only works if the file doesn't have "|" in the data.
since its fixed lenght file, there is no guarantee that i will only get data without "|" in the data.
sorry my bad, i didn't give the correct example., just modification,
51|341|5153100@|0047363758741
51|341|51533010@0|47363758741
515342|515360000020063758742
515349|51537|0|0047363758749
output should be
5153100@|0047363758741
51533010@0|47363758741
Thanks
Sachin.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. Shell Programming and Scripting
Hi Unix Champs,
I want to awk on a fixed length file.
Instead if the file was a delimited file, then I could have used -F and then could have easily done manipulation on the fields.
How do i do the same in case of fixed length file?
Thanks in Advance.
Regards. (7 Replies)
Discussion started by: c2b2
7 Replies
3. Shell Programming and Scripting
Hi,
Can we join two fixed length files in Unix using JOIN command? Is there any other command to accomplish the same?
Thanks,
G.Harikrishnan (6 Replies)
Discussion started by: gharikrishnan
6 Replies
4. Shell Programming and Scripting
OK I am somewhat new to UNIX programming please see what you can do to help.
I have a flat file that is a fixed length file containing different records based on the 1st character of each line. The 1st number at the beginning of the line is the record number, in this case it's record #1.
I... (3 Replies)
Discussion started by: ambroze
3 Replies
5. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
6. Shell Programming and Scripting
I have a 1250 byte record that I need to sort in column 10-19 and in column 301. I have tried the sort command, but it looks like it needs delimiters to work. The record can have spaces in a lot of its 1250 columns, but 10-19, and 301 are guaranteed. These columns are numeric too.
A sample... (1 Reply)
Discussion started by: mb1201
1 Replies
7. Shell Programming and Scripting
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies
8. Shell Programming and Scripting
I am very new to scripting and need to write a script that will extract the account number from a line that begins with HDR. For example, the file is as follows
HDR2010072600300405505100726 00300405505
LBJ FREEWAY DALLAS
TELEGRAPH ... (9 Replies)
Discussion started by: bds052189
9 Replies
9. Shell Programming and Scripting
I was trying to use the AIX 6.1 sort command to sort fixed-length data records, sorting by specific columns only. It took some time to figure out how to get it to work, so I wanted to share the solution. The sort man page wasn't much help, because it talks about field delimeters (default space... (1 Reply)
Discussion started by: CheeseHead1
1 Replies
10. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
PAF(1p) User Contributed Perl Documentation PAF(1p)
NAME
paf - Pod Abstract Filter. Transform Pod documents from the command line.
SYNOPSIS
sh$>
paf summary /usr/bin/paf
paf add_podcmds SomeModule.pm
paf sort -heading=METHODS Pod/Abstract/Node.pm # METHODS is default
paf sort summary Pod/Abstract/Node.pm
# See Pod::Abstract::Filter::overlay
paf overlay sort cut clear_podcmds SomeClass.pm
# -p will emit pod source, instead of spawning perldoc.
paf -p sort Pod::Abstract::Node
paf -p find hoist Pod::Abstract::Node
DESCRIPTION
Paf is a small but powerful, modular Pod filter and transformation tool. It allows full round-trip transformation of Pod documents using
the Pod::Abstract library, with multiple filter chains without having to serialise/re-parse the document at each step.
Paf comes with a small set of useful filters, but can be extended by simply writing new classes in the "Pod::Abstract::Filter" namespace.
FILTERS
add_podcmds
Add explicit =pod commands at the end of each cut section, so that all pod sections are started with an =pod command.
clear_podcmds
Remove all =pod commands that are not ending cut blocks. This will clean up documents that have been reduced using the "cut" filter too.
cut
Remove all cut nodes, so that only the pod remains.
overlay
paf overlay Source.pm
For overlay to work, there must be a "begin :overlay/end :overlay" section in the Source file, with "=overlay SECTION Module" definitions
inside. The net effect is that any missing subheadings in SECTION are added from the same section in the specified Modules.
Note that this will overlay the whole subheading, INCLUDING CUT NODES, so it can add code to the source document. Use "cut" if you don't
want this.
Each overlaid section will include a "=for overlay from" marker, so that it can be replaced by a subsequent overlay from the same
file/module. These sections will be replaced in-place, so ordering of sections once first overlaid will be preserved.
unoverlay
paf unoverlay Source.pm
Strips all sections marked as overlaid and matching the overlay spec from the source.
sort
paf sort [-heading=METHODS] Source.pm
Sort all of the subheadings in the named heading (METHODS if not provided).
This will move cut nodes around with their headings, so your code will mutate. Use "cut" if you only want pod in the output.
Alternatively, you can also cause sorting of headings to occur by including "=for sorting" at the start of your section (before the first
subheading).
summary
Provide an abbreviated summary of the document. If there is a verbatim node in the body of a heading containing the heading name, it will
be considered an example and expanded as part of the summary.
find
paf find [-f=]name Source.pm
Find specific sub-sections or list items mentioning name. Used to restrict a larger document down to a smaller set that you're interested
in. If no -f is specified, then the word following find will be the search term.
uncut
paf uncut Source.pm
Convert cut nodes in the source into verbatim text. Not the inverse of cut!
number_sections
paf number_sections Source.pm
Applies simple multipart (3.1.2) section numbering to head1 through head4 headings.
Note that number_sections will currently stuff up some of the cleverness in things like summary, as the section names won't match function
names any more.
perl v5.10.1 2010-01-03 PAF(1p)