Hello,
I am a novice in Perl. Can someone be kind enough to suggest a 'quick' script to accomplish the following:
1. Input - sequential text file.
2. Output - sequential text file.
3. Process:
a. Read and Write out 1st record ('column headings').
b. Process remaining data records:
I. If 'column headings' record, skip and read next.
II. Otherwise, Write record.
Here is a sample of the typical data:
Ticker,Date,MFI14Day,Volume,Buy,Sell
ASTM,2/19/1997,-10000000000,16200,0,0
ASTM,2/20/1997,-10000000000,38300,0,0
ASTM,2/21/1997,-10000000000,76900,0,0
ASTM,2/24/1997,-10000000000,12100,0,0
ASTM,2/25/1997,34.8644,3200,0,0
ASTM,2/26/1997,65.1594,42300,0,0
ASTM,2/27/1997,53.4249,41300,0,0
ASTM,2/28/1997,52.8976,2300,0,0
Ticker,Date,MFI14Day,Volume,Buy,Sell
NOIZ,10/5/1993,-10000000000,1000,0,0
NOIZ,10/14/1993,-10000000000,1000,0,0
NOIZ,10/15/1993,86.8409,200,0,0
NOIZ,10/20/1993,81.5143,2500,0,0
NOIZ,10/22/1993,93.9497,77400,0,0
NOIZ,10/25/1993,96.9449,89900,0,0
NOIZ,10/26/1993,92.5823,8400,0,0
NOIZ,10/27/1993,98.2712,252500,0,0
NOIZ,10/28/1993,98.6015,90500,0,0
Ticker,Date,MFI14Day,Volume,Buy,Sell
STEM,8/10/1993,-10000000000,6500,0,0
STEM,8/11/1993,-10000000000,16300,0,0
STEM,8/12/1993,-10000000000,12300,0,0
STEM,8/13/1993,-10000000000,300,0,0
STEM,9/1/1993,70.4803,20800,0,0
STEM,9/2/1993,68.4455,12800,0,0
STEM,9/3/1993,66.7471,700,0,0
STEM,9/7/1993,61.5999,27600,0,0
STEM,9/8/1993,47.1489,94800,0,0
Your assistance is greatly appreciated. Many thanks!
Joe
I am a novice in Perl. Can someone be kind enough to suggest a 'quick' script to accomplish the following:
1. Input - sequential text file.
2. Output - sequential text file.
3. Process:
a. Read and Write out 1st record ('column headings').
b. Process remaining data records:
I. If 'column headings' record, skip and read next.
II. Otherwise, Write record.
Here is a sample of the typical data:
Ticker,Date,MFI14Day,Volume,Buy,Sell
ASTM,2/19/1997,-10000000000,16200,0,0
ASTM,2/20/1997,-10000000000,38300,0,0
ASTM,2/21/1997,-10000000000,76900,0,0
ASTM,2/24/1997,-10000000000,12100,0,0
ASTM,2/25/1997,34.8644,3200,0,0
ASTM,2/26/1997,65.1594,42300,0,0
ASTM,2/27/1997,53.4249,41300,0,0
ASTM,2/28/1997,52.8976,2300,0,0
Ticker,Date,MFI14Day,Volume,Buy,Sell
NOIZ,10/5/1993,-10000000000,1000,0,0
NOIZ,10/14/1993,-10000000000,1000,0,0
NOIZ,10/15/1993,86.8409,200,0,0
NOIZ,10/20/1993,81.5143,2500,0,0
NOIZ,10/22/1993,93.9497,77400,0,0
NOIZ,10/25/1993,96.9449,89900,0,0
NOIZ,10/26/1993,92.5823,8400,0,0
NOIZ,10/27/1993,98.2712,252500,0,0
NOIZ,10/28/1993,98.6015,90500,0,0
Ticker,Date,MFI14Day,Volume,Buy,Sell
STEM,8/10/1993,-10000000000,6500,0,0
STEM,8/11/1993,-10000000000,16300,0,0
STEM,8/12/1993,-10000000000,12300,0,0
STEM,8/13/1993,-10000000000,300,0,0
STEM,9/1/1993,70.4803,20800,0,0
STEM,9/2/1993,68.4455,12800,0,0
STEM,9/3/1993,66.7471,700,0,0
STEM,9/7/1993,61.5999,27600,0,0
STEM,9/8/1993,47.1489,94800,0,0
Your assistance is greatly appreciated. Many thanks!
Joe