![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parse through one text file and output many | sophiadun | UNIX for Dummies Questions & Answers | 14 | 02-20-2008 06:08 AM |
| parse text file | klick81 | Shell Programming and Scripting | 3 | 12-18-2006 12:04 PM |
| Parse Text file and send mails | Amruta Pitkar | UNIX for Dummies Questions & Answers | 12 | 08-11-2006 04:56 AM |
| How to parse a text file with \034 as field and \035 as end of message delimiter? | indianya | Shell Programming and Scripting | 1 | 08-26-2005 10:20 PM |
| parse text or complex grep ? | jacost | UNIX for Dummies Questions & Answers | 4 | 04-29-2004 08:58 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
parse text file
I have a file that has a header followed by 8 columns of data. I want to toss out the header, and then write the data to another file with a different header and footer. I also need to grab the first values of the first and second column to put in the header.
How do I chop off the header? How do I read the first line to get the 1st 2 column values? Thanks |
|
||||
|
The input has 21 header lines and then:
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 I want the output to be the same except for the date/time to be an increment in seconds from the first time: 0 60 120 etc... |
|
||||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|