How i extract some lines of a text

October 28, 2010 at 00:35:50
Specs: Windows XP
10/26/2010 3:16:02:513PM
ScripCd|ScripName|YearHigh|YearLow|OpenPrice|ScripHigh|ScripLow|ClosePrice|PrevClosePrice|Trades|Volume|Value
NALI|NATIONAL LIFE INSURANCE CO.LTD|10622.00|3665.00|7430.00|7030.25|7030.25|7030.25|7430.00|1|5|35151.25
SGTEX|SONARGAON TEXTILES LIMITED|1199.00|336.25|1095.25|1055.00|1000.00|1032.00|1095.25|15|850|877300.00
DLSP|DELTA SPINNERS LIMITED|774.00|435.00|762.75|788.00|751.00|760.00|762.75|467|24180|18692535.00

I like to have the data like this
Ticker,Date,Open,High,Low,Close,Volume
NALI,10/26/2010,7430.00,7030.2,7030.25,|7030.25,5

how i can do it? Please give me a suggestion


See More: How i extract some lines of a text

Report •

#1
October 28, 2010 at 01:11:41
NALI,10/26/2010,7430.00,7030.2,7030.25,|7030.25,5
                         =====        ==

Please review what you want in the output file, the fourth field (7030.2) does not agree with the input field (7030.25) and do you require both the , (comma) and | (pipe) between fifth and sixth fields?


Report •

#2
October 28, 2010 at 02:04:18

This is original data,

GDI|GREEN DELTA INSURANCE COMPANY|3199.00|1531.00|2970.00|3195.00|3026.00|3063.00|2970.00|43|800|2458830.00

I like to have the data which can be like following under..

ScripCd|YearHigh|YearLow|OpenPrice|ScripHigh|ScripLow|Volume

GDI|3199.00|1531.00|2970.00|3195.00|3026.00|800


Report •

#3
October 28, 2010 at 07:35:03
This is original data,
GDI|GREEN DELTA INSURANCE COMPANY|3199.00|1531.00|2970.00|3195.00|3026.00|3063.00|2970.00|43|800|2458830.00

I like to have the data which can be like following under..
ScripCd|YearHigh|YearLow|OpenPrice|ScripHigh|ScripLow|Volume
GDI|3199.00|1531.00|2970.00|3195.00|3026.00|800

Can any one tell me how i can do this?


Report •

Related Solutions

#4
October 28, 2010 at 14:24:43
Test this:

@echo off>output.txt
setlocal 
cls

for /f "skip=1 tokens=1-12 delims=|" %%A in (inputfilename.ext) do (
    >>outputfilename.ext echo %%A^|%%C^|%%D^|%%E^|%%F^|%%G^|%%K
)                            
                            


Report •

Ask Question