Sponsored Content
Top Forums Shell Programming and Scripting Parsing a line in Shell Script Post 302143341 by unishiva on Wednesday 31st of October 2007 07:26:06 PM
Old 10-31-2007
Parsing a line in Shell Script

I have record line somthing like below with first line showing char spacing not real record line
1 | 2 | 3rd Field--------------|-4th field--| This is charcatersapcing of line
DF20000000000000000130.7890000000750

I shoudl get two line from above line
1st line should
1 | 2 | 3rd Field-------------|4th field--| This is charcatersapcing of line
DF125000000000000000000000000000000 Here the second field is (2nd - 4th filed in the above line

2ndst line should
1 | 2 | 3rd Field---------------|-4thfield--| This is charcatersapcing of line
DF075000000000000000130.7890000000000
respective (ie 1 2 3 4) Field lenths in all the records are same
Please let me know what is best way of doing this.

Thanks
uni

Last edited by unishiva; 10-31-2007 at 08:35 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parsing text from one line with shell scripts

Hi Gurus! I wonder if anyone can help me, I'm sure you guys can. I have a text file which contains a lot of data on the one line as follows: $ What I need to do is pull all of those id values out (eg 2549425) and write them to a list in a text file. Any help would be greatly... (3 Replies)
Discussion started by: th3g0bl1n
3 Replies

2. UNIX for Dummies Questions & Answers

shell script parsing with sed

#I'm quite new to scripting and my boss has asked me to solve a simple problem and sadly, I can't figure out how to do it. Any help is appreciated. :confused: #The following is a small shell script and the output that it produces for google.com. #!/bin/sh whois $1 | grep "Name Server"... (5 Replies)
Discussion started by: jjamd64
5 Replies

3. Shell Programming and Scripting

Shell script to parsing log

Hi I Have log like this : 0 234: { 3 2: 04 EE 7 14: '20081114081' 23 1: 00 79 10: '38809' 91 15: '528111510010159' 143 29: 'Streaming/downloading service' 174 3: 'MTV' 179 43: 'rtsp://172.28/MTV2GO-Loop.sdp' 224 1: 05 ... (10 Replies)
Discussion started by: justbow
10 Replies

4. Shell Programming and Scripting

Parsing XML using Shell Script

Hello, I'm a starting shell scripter and no Perl knowledge. I've trying to do this for a while: I want to parse an XML file and get certain data out of it and write that data into a CSV file, all this using Shell Scripting (in Bash). Or Perl without any XML Parser/Interpreter (if possible). ... (1 Reply)
Discussion started by: Kage Musha
1 Replies

5. Shell Programming and Scripting

XML parsing using shell script

I have a xml file like this <bul:collectionStrategy name="strategy1"> <bul:collectionTemplateGroup name="15min group"/> <bul:collectionTemplateGroup name="hourly group"/> </bul:collectionStrategy> <bul:CollectionTemplateGroup name="hourly group" > ... (2 Replies)
Discussion started by: LavanyaP
2 Replies

6. Shell Programming and Scripting

parsing using shell script

I have a file parameters.txt which contains 151524 151525 I have another file OID.csv which contains NE Version Object Type ID SDK param name Object OID test1 Start: 4.2 End: 4.2 pan 151524 speed ... (5 Replies)
Discussion started by: LavanyaP
5 Replies

7. Shell Programming and Scripting

Parsing a command line parameter in script

I have a simple script that builds a complex program call which passes a number of parameters to the program. I'm trying to enhance the script to include the value of the command line parameter in the name of a file being created. The problem I'm having is that the parameter may include a forward... (11 Replies)
Discussion started by: pbmax626
11 Replies

8. Shell Programming and Scripting

Parsing XML using shell script

Well, issue is i have to parse this script to get the VERSION: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleAllowMixedLocalizations</key> ... (9 Replies)
Discussion started by: zorosinister
9 Replies

9. Shell Programming and Scripting

Parsing line with name:value pairs in shell script

HI , I have the following type of lines in a file and need to create a csv file that can be bcp'ed into a db The problem that I have is the delimited of the <name :value> is a space but some of the values in the pairs have space . eg msg_src_time:03/05/13 10:40:17.919 Need sugesstions on... (9 Replies)
Discussion started by: tasmac
9 Replies

10. Shell Programming and Scripting

Parsing Command Line Arguments In C shell script

]I have a string like "/abc/cmind/def/pq/IC.2.4.6_main.64b/lnx86" and this string is given by user. But in this string instead of 64b user may passed 32 b an i need to parse this string and check wether its is 32b or 64 b and according to it i want to set appropriate flags. How will i do this... (11 Replies)
Discussion started by: codecatcher
11 Replies
Validation::Class::Field(3pm)				User Contributed Perl Documentation			     Validation::Class::Field(3pm)

NAME
Validation::Class::Field - Field Object for Validation::Class Classes VERSION
version 7.70 SYNOPSIS
package SomeClass; use Validation::Class; package main; my $class = SomeClass->new; ... my $field = $class->get_field('some_field_name'); $field->apply_filters; $field->validate; # validate this only $field->errors->count; # field-level errors 1; DESCRIPTION
Validation::Class::Field is responsible for field data handling in Validation::Class derived classes, performs functions at the field-level only. This class automatically creates attributes for all acceptable field directives as listed under "DIRECTIVES" in Validation::Class::Prototype. ATTRIBUTES
errors The errors attribute is a Validation::Class::Errors object. METHODS
new my $self = Validation::Class::Field->new({ name => 'some_field_name' }); AUTHOR
Al Newkirk <anewkirk@ana.io> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Al Newkirk. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Validation::Class::Field(3pm)
All times are GMT -4. The time now is 05:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy