text to excel -Help

  • Thread starter Thread starter Kumaras
  • Start date Start date
K

Kumaras

Hello all,
I have a text file as below which i need to convert to excel ...
ID=ANALOG2:TIC3601, PD=REACTOR 1 JACKET TEMP CONTROLLER, DB=1, SR=10,
RC=216;
ID=ANALOG2:TIC3601, PD=REACTOR 2 JACKET TEMP CONTROLLER, DB=2, SR=20,
RC=216;
ID=ANALOG2:TIC3601, PD=REACTOR 1 CORE TEMP CONTROLLER, DB=2, SR=30,
RC=216;
ID=ANALOG2:TIC3601, PD=REACTOR 2 CORE TEMP CONTROLLER, DB=1, SR=10,
RC=216;

It should look like this in excel with columnwise with header,is there
a code please help
ID PD DB SR RC
ANALOG2:TIC3601 REACTOR 1 JACKET TEMP CONTROLLER 1 10 216
ANALOG2:TIC3601 REACTOR 2 JACKET TEMP CONTROLLER 2 30 216
ANALOG2:TIC3601 REACTOR 1 CORE TEMP CONTROLLER 2 30 216
ANALOG2:TIC3601 REACTOR 2 CORE TEMP CONTROLLER 1 10 216

Thanks

A.kumar
 
I'd just import the text file into excel--delimited by commas.

Then select the first column
edit|Replace
what: ID=
with: (leave blank)
replace all

Same thing with PD=, DB=, SR= and RC= and the final semicolon.

And just add the headers manually.

If you need to do this via a macro, you could record a macro when you do it once
manually.
 
using split "," then split "="
e.g.
Dim k ' Split values ,array
k = Split(Details(cnt), "|", -1, vbTextCompare)
If UBound(k) > 0 Then
loSheet.Cells(Act, COL_INVOICE_DATE).Value = "Aging for " +
k(1) + ":"
loSheet.Cells(Act, COL_INVOICE_DATE).Select
With Selection.Font
.Name = "Times New Roman"
.Bold = True
End With
Act = Act + 1
End If
 
You sure this belongs in this thread?
using split "," then split "="
e.g.
Dim k ' Split values ,array
k = Split(Details(cnt), "|", -1, vbTextCompare)
If UBound(k) > 0 Then
loSheet.Cells(Act, COL_INVOICE_DATE).Value = "Aging for " +
k(1) + ":"
loSheet.Cells(Act, COL_INVOICE_DATE).Select
With Selection.Font
.Name = "Times New Roman"
.Bold = True
End With
Act = Act + 1
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top