convert ASCII file (attached file) to excel

Hi All,

Please help us in creating a code to convert LAS (attached file) to excel / CSV .
NewDTSAgilentSensor-18Nov2017-155915.txt
Mohammed DallagPetroleum ConsultantAsked:
Who is Participating?
 
aikimarkCommented:
This code will parse the header:
https://www.experts-exchange.com/questions/29082032/Format-Text-file-to-Excel.html#a42457322
You will need to change line 64 to:
    oRE.Pattern = "(" & Join(dicHeader.keys, "|") & ")\s*:\s*(\S[^\r]*)(?:\r|$)"

Open in new window

since there are space characters before the colon.
0
 
MacroShadowCommented:
Can you give a sample of how you expect it to look in Excel?
0
 
Gustav BrockCIOCommented:
You must provide some more info - or you leave us in a guessing contest.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
aikimarkCommented:
1. Bring it all into Excel
2. Delete the rows at the top
3. split the remaining rows into three columns, based on the " " delimiter
0
 
NorieVBA ExpertCommented:
Mohammed

This is definitely doable, probably quite straightforward in fact, but without further info, as MacroShadow and Gustav have indicated, we can't help.:)
0
 
d-glitchCommented:
I just did as aikimark  has suggested, but I left the header lines alone.
I selected the data and ran Data/Text-to-Columns with Tab and Space as delimiters.
 Text-to-Col-for-ExEx.xlsx
0
 
Mohammed DallagPetroleum ConsultantAuthor Commented:
ٍsorry I was not clear I need the header to be in separate sheet and only the names under the curve header with the columns like the attached sheet and I may have many columns to be converted
0
 
Gustav BrockCIOCommented:
This is clear as mud. Why not be specific?
The only keyword you have mentioned is curve. Guess that is ~curve.
But what else?
0
 
Mohammed DallagPetroleum ConsultantAuthor Commented:
~Curve
#MNEM.UNIT      LOG CODES               CURVE DESCRIPTION
#---------------------------------------------------------------------------------------------------------------------
DEPTH.M 123 456 789 : DEPTH
TEMPERATURE.DEGC 123 456 789 : TEMPERATURE
TEMPERATURE.DEGC 123 456 789 : TEMPERATURE

each column header will be the CURVE DESCRIPTION under ~Curve

DEPTH   TEMPERATURE   TEMPERATURE
0
 
Neil FlemingConsultant and developerCommented:
Does this work for you?

You need to double click on the file name to change the source file.

Also currently the code will only run once for one file name. It is using the file name to name the sheet into which it imports. So to re-test, at present, you need to delete the sheet.
ReadLog.xlsm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.