• Home
  • Blog
  • Resume
  • Contact
  • Projects
  • Gallery
  • Amit’s Resume
  • About Nagpur
KEEP IN TOUCH

Parse data with double spaces

Aug24
2005
Leave a Comment Written by admin

Now, this is very easy to do. But at office spent some good time tackling this problem. The problem was–we had data as a text file from Oracle output, which somehow had double spaces as delimiters, and we got that very late. We had a SAS program, which used to read the file and that program was not working. Then we turned to Excel (of course), and within seconds we got a parsed file.
Here is the code for that.

Public Sub parse_file()
Application.ScreenUpdating = False
Dim i As Integer, j As Long, k As Long, no_of_rows As Long, storeVal, parsedVal
no_of_rows = Range(“A65536″).End(xlUp).Row
For i = 1 To no_of_rows
    storeVal = Range(“A” & i)
    parsedVal = Split(storeVal, “  ”)
    j = UBound(parsedVal)
    Range(Cells(i, 1), Cells(i, j + 1)) = parsedVal
Next i
Application.ScreenUpdating = True
MsgBox “Done”
End Sub

Related posts:

  1. Save HTML files from one folder to Excel files in another folder
  2. Importing IE bookmark
Posted in Uncategorized - Tagged Public Sub, SAS
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
« True blanks
» Excel Instructions – Exponential Distribution

No Comments Yet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Tags

Access Alt F8 Books boxplot cells charts count cursor dashboard data mining dbase design error excel excel functions export filter flip LaTex MS query Number Err ODBC pipes Press Alt F11 Public Sub python R random numbers Range Cells report scripting software sparklines SQL SQL server stack columns statistics stemming string tag cloud text mining UDF VBA visualization wildcard

Network

View Ashutosh Nandeshwar's profile on LinkedIn

Recent Comments

  • larry on Access Export to Excel (2007)
  • Betty Chou on Projects
  • Rwill on Access Export to Excel (2007)
  • Bharathi on The search key was not found in any record in Access
  • Michael on The search key was not found in any record in Access

Related Posts

  1. Save HTML files from one folder to Excel files in another folder
  2. Importing IE bookmark

EvoLve theme by Blogatize  •  Powered by WordPress nandeshwar.info