![]() |
|
|
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 |
| Deleting lines above a certain line | eltinator | Shell Programming and Scripting | 3 | 10-11-2007 03:29 PM |
| Moving lines within a txt file | innocentspirit | Shell Programming and Scripting | 5 | 09-28-2007 01:04 AM |
| deleting lines using awk-best way? | satnamx | Shell Programming and Scripting | 3 | 08-29-2007 08:24 PM |
| Moving next 2 lines contents to previous lines | Amruta Pitkar | Shell Programming and Scripting | 8 | 04-26-2007 07:09 AM |
| deleting lines | ajnabi | Shell Programming and Scripting | 8 | 05-02-2003 12:50 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi,
I need convert a dump file in the following format : (please note that line numbers are provided for easy look) Original file: 1 2007-10-2482.90 No trade 0 0.00 100000.00 2 100000.00 3 0.00 4 HOLD 5 2007-10-2589.75 Bought 1114 1114 100000.00 0.00 6 100000.00 7 -0.00 8 STRONG BUY 9 2007-10-2692.35 No trade 1114 102896.94 0.00 10 102896.94 11 2.90 12 STRONG BUY 13 2007-10-2991.20 No trade 1114 101615.60 0.00 14 101615.60 15 1.62 16 STRONG BUY 17 2007-10-3090.05 No trade 1114 100334.26 0.00 18 100334.26 19 0.33 20 STRONG BUY 21 2007-10-3188.45 No trade 1114 98551.53 0.00 22 98551.53 23 -1.45 24 STRONG BUY 25 2007-11-0183.70 Sold 1114 0 0.00 93259.05 26 93259.05 27 -6.74 28 STRONG SELL Modifiled file : 1 2007-10-2482.90 No trade 0 0.00 100000.00 HOLD 2 2007-10-2589.75 Bought 1114 1114 100000.00 0.00 STRONG BUY 3 2007-10-2692.35 No trade 1114 102896.94 0.00 STRONG BUY 4 2007-10-2991.20 No trade 1114 101615.60 0.00 STRONG BUY 5 2007-10-3090.05 No trade 1114 100334.26 0.00 STRONG BUY 6 2007-10-3188.45 No trade 1114 98551.53 0.00 STRONG BUY 7 2007-11-0183.70 Sold 1114 0 0.00 93259.05 STRONG SELL That is, every 4 line of the input file needs to converted into a single line - after deleting 2nd and 3rd line. A perl script to do this would be great. (sed will also fulfill my purpose but perl way will be highly appreciated). Awaiting for your help! ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|