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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

NorieAnalyst Assistant Commented:
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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.