Sponsored Content
Full Discussion: parse text file
Top Forums Shell Programming and Scripting parse text file Post 302108430 by craggm on Monday 26th of February 2007 12:22:38 PM
Old 02-26-2007
That still doesn't work, it only appends an incorrect number of seconds to the time.

My input is:

Ephemeris Report


...
...
...
...



UTC ECI Pos.x ECI Pos.y ECI Pos.z ECI Vel.x ECI Vel.y ECI Vel.z
meters meters meters m/sec m/sec m/sec


2007/02/14 14:35:00.000 -3290487.916 5918823.251 -937336.4914 343.2155631 1370.243225 7504.940754
2007/02/14 14:36:00.000 -3262514.423 5987671.968 -485265.2305 588.8979381 923.8295738 7558.439209
2007/02/14 14:37:00.000 -3219871.692 6029597.035 -31005.43118 832.0042338 473.1283695 7577.860785
2007/02/14 14:38:00.000 -3162747.636 6044402.618 423394.2676 1071.424968 20.18994397 7563.097944
2007/02/14 14:39:00.000 -3091396.287 6032016.360 875883.6179 1306.067023 -432.9220146 7514.205215
2007/02/14 14:40:00.000 -3006136.556 5992489.764 1324420.491 1534.861850 -884.1448333 7431.397557
2007/02/14 14:41:00.000 -2907350.655 5925997.845 1766980.355 1756.768150 -1331.424860 7315.046723
2007/02/14 14:42:00.000 -2795482.373 5832838.365 2201565.704 1970.776041 -1772.726794 7165.681230
2007/02/14 14:43:00.000 -2671034.953 5713430.291 2626215.312 2175.914098 -2206.046799 6983.981273
2007/02/14 14:44:00.000 -2534568.723 5568311.769 3039013.259 2371.251606 -2629.417536 6770.776200
2007/02/14 14:45:00.000 -2386698.515 5398137.633 3438097.768 2555.903143 -3040.918130 6527.041193
2007/02/14 14:46:00.000 -2228090.794 5203676.276 3821669.786 2729.034079 -3438.686801 6253.889806
2007/02/14 14:47:00.000 -2059460.490 4985805.802 4188001.060 2889.863602 -3820.928429 5952.568581
...
...
...


and I want the ouput to be:

0 -3290487.916 5918823.251 -937336.4914 343.2155631 1370.243225 7504.940754
60 -3262514.423 5987671.968 -485265.2305 588.8979381 923.8295738 7558.439209
120 -3219871.692 6029597.035 -31005.43118 832.0042338 473.1283695 7577.860785
180 -3162747.636 6044402.618 423394.2676 1071.424968 20.18994397 7563.097944
240 -3091396.287 6032016.360 875883.6179 1306.067023 -432.9220146 7514.205215
300 -3006136.556 5992489.764 1324420.491 1534.861850 -884.1448333 7431.397557
360-2907350.655 5925997.845 1766980.355 1756.768150 -1331.424860 7315.046723
420 -2795482.373 5832838.365 2201565.704 1970.776041 -1772.726794 7165.681230
480 -2671034.953 5713430.291 2626215.312 2175.914098 -2206.046799 6983.981273
540 -2534568.723 5568311.769 3039013.259 2371.251606 -2629.417536 6770.776200
600 -2386698.515 5398137.633 3438097.768 2555.903143 -3040.918130 6527.041193
660 -2228090.794 5203676.276 3821669.786 2729.034079 -3438.686801 6253.889806
720 -2059460.490 4985805.802 4188001.060 2889.863602 -3820.928429 5952.568581
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parse Text file and send mails

Please help. I have a text file which looks something like this aaa@abc.com, c:FilePath\Eaaa.txt bbb@abc.com, c:FilePath\Ebbb.txt ccc@abc.com, c:FilePath\Eccc.txt ddd@abc.com, c:FilePath\Eddd.txt...so on I want to write a shell script which will pick up the first field 'aaa@abc.com' and... (12 Replies)
Discussion started by: Amruta Pitkar
12 Replies

2. Shell Programming and Scripting

parse text file

i am attempting to parse a simple text file with multiple lines and four fields in each line, formatted as such: 12/10/2006 12:34:06 77 38 this is what i'm having problems with in my bash script: sed '1,6d' $RAWDATA > $NEWFILE #removes first 6 lines from file, which are... (3 Replies)
Discussion started by: klick81
3 Replies

3. UNIX for Dummies Questions & Answers

parse through one text file and output many

Hi, everyone The input file pattern is like below: Begin Object1 txt1 end ; Begin Object2 txt2 end ; ... (14 Replies)
Discussion started by: sophiadun
14 Replies

4. Shell Programming and Scripting

Trying to Parse Version Information from Text File

I have a file name version.properties with the following data: major.version=14 minor.version=234 I'm trying to write a grep expression to only put "14" to stdout. The following is not working. grep "major.version=(+)" version.properties What am I doing wrong? (6 Replies)
Discussion started by: obfunkhouser
6 Replies

5. Shell Programming and Scripting

How to parse a file for text b/n double quotes?

Hi guys, I desperately need some help here... I need to parse a file similar to this: I need to read the values for MY_BANNER_SSHD and WARNING_MESSAGE. The value could be empty/single line or multi-line! # Comments . . . Some lines MY_BANNER_SSHD=""... (7 Replies)
Discussion started by: shreeda
7 Replies

6. Shell Programming and Scripting

Parse and Join in a text file

I wanted to parse a text file and join in specific format. please suggest me how to get this done.. The output should be in fasta format which consists of lines starting with ID, PT, PA and Sequence. "//" the two slashes are dividing lines between two different sequences. Like... (10 Replies)
Discussion started by: empyrean
10 Replies

7. Shell Programming and Scripting

script to parse text file into sql commands

Hello all, I tried searching for something similiar before posting but couldn't come up with anything that fit what I need. In Linux, I'm trying to parse through a number of files and take the info in them and put it into mysql. My file is a dump from an expect script: ---filename... (3 Replies)
Discussion started by: hamanjam
3 Replies

8. Shell Programming and Scripting

Parse text file using specific tags

awk -F "" '/<href=>|<href=>|<top>|<top>/ {print $3, OFS=\t}' source.txt > output.txt I'm not quite sure how to parse the attached file, but what I am trying to do is in a output file have the link (href=), name (after the <), and count (<top>) in 3 separate columns. My attempt is the above... (2 Replies)
Discussion started by: cmccabe
2 Replies

9. Shell Programming and Scripting

awk to parse file and display result based on text

I am trying using awk to open an input file and check a column 2/field $2 and if there is a warning then that is displayed (variantchecker): G not found at position 459, found A instead. The attached Sample1.txt is that file. If in that column/field there is a black space, then the text after... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

Parse file for fields and specific text

I have a file of ~500,000 entries in the following: file.txt chr1 11868 12227 ENSG00000223972.5 . + HAVANA exon . gene_id "ENSG00000223972.5"; transcript_id "ENST00000456328.2"; gene_type "transcribed_unprocessed_pseudogene"; gene_status "KNOWN"; gene_name "DDX11L1"; transcript_type... (17 Replies)
Discussion started by: cmccabe
17 Replies
HTML::HeadParser(3)					User Contributed Perl Documentation				       HTML::HeadParser(3)

NAME
HTML::HeadParser - Parse <HEAD> section of a HTML document SYNOPSIS
require HTML::HeadParser; $p = HTML::HeadParser->new; $p->parse($text) and print "not finished"; $p->header('Title') # to access <title>....</title> $p->header('Content-Base') # to access <base href="http://..."> $p->header('Foo') # to access <meta http-equiv="Foo" content="..."> $p->header('X-Meta-Author') # to access <meta name="author" content="..."> $p->header('X-Meta-Charset') # to access <meta charset="..."> DESCRIPTION
The "HTML::HeadParser" is a specialized (and lightweight) "HTML::Parser" that will only parse the <HEAD>...</HEAD> section of an HTML document. The parse() method will return a FALSE value as soon as some <BODY> element or body text are found, and should not be called again after this. Note that the "HTML::HeadParser" might get confused if raw undecoded UTF-8 is passed to the parse() method. Make sure the strings are properly decoded before passing them on. The "HTML::HeadParser" keeps a reference to a header object, and the parser will update this header object as the various elements of the <HEAD> section of the HTML document are recognized. The following header fields are affected: Content-Base: The Content-Base header is initialized from the <base href="..."> element. Title: The Title header is initialized from the <title>...</title> element. Isindex: The Isindex header will be added if there is a <isindex> element in the <head>. The header value is initialized from the prompt attribute if it is present. If no prompt attribute is given it will have '?' as the value. X-Meta-Foo: All <meta> elements containing a "name" attribute will result in headers using the prefix "X-Meta-" appended with the value of the "name" attribute as the name of the header, and the value of the "content" attribute as the pushed header value. <meta> elements containing a "http-equiv" attribute will result in headers as in above, but without the "X-Meta-" prefix in the header name. <meta> elements containing a "charset" attribute will result in an "X-Meta-Charset" header, using the value of the "charset" attribute as the pushed header value. The ':' character can't be represented in header field names, so if the meta element contains this char it's substituted with '-' before forming the field name. METHODS
The following methods (in addition to those provided by the superclass) are available: $hp = HTML::HeadParser->new $hp = HTML::HeadParser->new( $header ) The object constructor. The optional $header argument should be a reference to an object that implement the header() and push_header() methods as defined by the "HTTP::Headers" class. Normally it will be of some class that is a or delegates to the "HTTP::Headers" class. If no $header is given "HTML::HeadParser" will create an "HTTP::Headers" object by itself (initially empty). $hp->header; Returns a reference to the header object. $hp->header( $key ) Returns a header value. It is just a shorter way to write "$hp->header->header($key)". EXAMPLE
$h = HTTP::Headers->new; $p = HTML::HeadParser->new($h); $p->parse(<<EOT); <title>Stupid example</title> <base href="http://www.linpro.no/lwp/"> Normal text starts here. EOT undef $p; print $h->title; # should print "Stupid example" SEE ALSO
HTML::Parser, HTTP::Headers The "HTTP::Headers" class is distributed as part of the libwww-perl package. If you don't have that distribution installed you need to provide the $header argument to the "HTML::HeadParser" constructor with your own object that implements the documented protocol. COPYRIGHT
Copyright 1996-2001 Gisle Aas. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-05-08 HTML::HeadParser(3)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy