01-14-2009
Quote:
Originally Posted by
riderman
sorry doesn't work...
fyi i'm using awk95 in a windows xp...
What does "doesn't work" mean? What happens? In what way is it not what you want?
Which script "doesn't work"?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a text file with a very long list of dates, one date per line. Each date is in the same format yyyymmdd. I need the dates to be in mmddyyyy format.
This is part of a larger tcsh shell script.
I am just learning unix and came up with:
for each line in file
for each character in... (4 Replies)
Discussion started by: yankee428
4 Replies
2. Shell Programming and Scripting
I have a file that is semi-colon delimited and the column headers are always the same but the column number is totally random each time this file is generated. I don't have the skills to make a script for this so maybe someone can help.
I would like to be able to take this file which has over... (11 Replies)
Discussion started by: n3al10
11 Replies
3. Shell Programming and Scripting
Please I need to rearrange data acquired by USB port from a sensor network. The information is mixed and I need to convert it into a kind of table. This is my input file:
Node 4D5A joined
Temperature: 27,5
Humidity: 40
Dew Point: 23
No motion detected
LUX: 389
Temperature: 28
Humidity: 41... (5 Replies)
Discussion started by: csecnarf
5 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
I need to rearrange the content of the file. I need to move line 1 to 4, 2 to 3, 3 to 2, and 4 to 1.
IPlease help. I was thinking about using head and tail command.
Here is the original file.
aa
bb
cc
dd
Here is what I need it to be.
dd
cc
bb
aa
Thanks. (6 Replies)
Discussion started by: sirrtuan
6 Replies
5. Shell Programming and Scripting
Gents,
I have a large file and each line of the file contains more than 200 bytes.Please let me a way to have the new line to start when the word "FIT" appears.
I was trialling with 'tr' command but i am not sure how to get it based on bytes and so it wasn't working...
Current... (3 Replies)
Discussion started by: appu2176
3 Replies
6. Shell Programming and Scripting
Hi,
I am required to arrange columns of a file i.e make the 15th column into the 1st column.
I am doing
awk 'begin {fs=ofs=","} {print $15,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14}' ad.data>ad.csv
the problem is that column 15 gets to column 1 but it is not comma separated with the... (10 Replies)
Discussion started by: seddoubt
10 Replies
7. UNIX for Dummies Questions & Answers
This is my first post, I apologize if I have broken rules.
Some assistance with the following will be very helpful.
I have a couple of files, both should ultimately have common columns only, arranged in the same order.
This file needs to be transposed, to bring the rows to columns
... (2 Replies)
Discussion started by: abh.kumar
2 Replies
8. Shell Programming and Scripting
I have 1 row which contains abouts 20000 base64 string.
e.g:
/p4bdllBS8qcvW/69GUYej8nEv6gwt7UAYl0g==WZdjwTUQX9UEKsT/zWaZdQ==uI would like rearrange this file by base64 strings. So the output should be this ( 1 string in 1 row):
69GUYej8nEv6gwt7UAYl0g==
WZdjwTUQX9UEKsT/zWaZdQ==How could I do... (4 Replies)
Discussion started by: freeroute
4 Replies
9. Shell Programming and Scripting
Hello,
I have some tab delimited text data,
index name chg_p chg_m
1 name,1 1 0
2 name,2 1 1
3 name,3 1 0
4 name,4 1 0
5 name,5 1 1
I need to duplicate the "index" column, call it "id" and insert it after the... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
10. Shell Programming and Scripting
I want to rearrange the fields of delimited text file after sorting first line (only):
input file:
a_13;a_2;a_1;a_10
13;2;1;10
the result should be:
a_1;a_2;a_10;a_13
1;2;10;13
any help would be appreciated
andy (20 Replies)
Discussion started by: andy2000
20 Replies
LEARN ABOUT DEBIAN
bind::config::parser
BIND::Config::Parser(3pm) User Contributed Perl Documentation BIND::Config::Parser(3pm)
NAME
BIND::Config::Parser - Parse BIND Config file.
SYNOPSIS
use BIND::Config::Parser;
# Create the parser
my $parser = new BIND::Config::Parser;
my $indent = 0;
# Set up callback handlers
$parser->set_open_block_handler( sub {
print " " x $indent, join( " ", @_ ), " {
";
$indent++;
} );
$parser->set_close_block_handler( sub {
$indent--;
print " " x $indent, "};
";
} );
$parser->set_statement_handler( sub {
print " " x $indent, join( " ", @_ ), ";
";
} );
# Parse the file
$parser->parse_file( "named.conf" );
DESCRIPTION
BIND::Config::Parser provides a lightweight parser to the configuration file syntax of BIND v8 and v9 using a "Parse::RecDescent" grammar.
It is in a similar vein to "BIND::Conf_Parser". However, as it has no knowledge of the directives, it doesn't need to be kept updated as
new directives are added, it simply knows how to carve up a BIND configuration file into logical chunks.
CONSTRUCTOR
new( );
Create a new "BIND::Config::Parser" object.
METHODS
set_open_block_handler( CODE_REF );
Set the code to be called when a configuration block is opened. At least one argument will be passed; the name of that block, for
example "options" or "zone", etc. as well as any additional items up to but not including the opening curly brace.
set_close_block_handler( CODE_REF );
Set the code to be called when a configuration block is closed. No arguments are passed.
set_statement_handler( CODE_REF );
Set the code to be called on a single line configuration element. At least one argument will be passed; the name of that element, as
well as any additional items up to but not including the ending semi-colon.
parse_file( FILENAME );
Parse FILENAME, triggering the above defined handlers on the relevant sections.
TODO
Probably the odd one or two things. I'm fairly sure the grammar is correct.
COPYRIGHT AND LICENSE
Copyright (c) 2005 Matt Dainty.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHORS
Matt Dainty <matt@bodgit-n-scarper.com>.
SEE ALSO
perl, Parse::RecDescent, BIND::Conf_Parser.
perl v5.14.2 2005-06-26 BIND::Config::Parser(3pm)