Thursday, February 23, 2017

Add Random Data in Spreadsheet

There can be various ways to add random data in spreadsheet, sometime we need high number of records to start a unit testing, but dev application not having too much of data initially. Here is the example how to add number of records in spreadsheet, i my case best way is use macro code.

To add random data in spreadsheet you can use macro code and you have to save spreadsheet "macro enable workbook" if you are using higher version of office, advantage to use this code is no more manual work. Use below code to generate data.

Public Sub ran()
Dim b As Range
    For i = 1 To 800000
        Dim r As Double
        r = Int(Timer * Rnd())
        Cells(i, 20).Value = 0
        Cells(i, 21).Value = "USD"
        Cells(i, 22).Value = ""
        Cells(i, 23).Value = "A clever fox just jump over the lazy dog"
        Cells(i, 24).Value = r
    Next i
End Sub

Dynamic data generated in "r" variable and rest of data is static.

Best way to run macro
1. Save spreadsheet in Macro enable workbook
2. Record the Macro
3. Stop the Macro
4. Then go to Macro > and Edit
5. Copy and paste above code in popup window
6. and run the macro code

Friday, February 10, 2017

Talend Startup Error

My machine is installed with java 1.7 and 1.8 both and i have moved to environment setting of computer and observed that JAVA_HOME environment variable set to 1.7., When i tries to to start the talend ETL tool on my machine, it throws the version error. Here i am writing this article to resolve this error. You can like, share, and add your value able comments in this post if it helps you.

Here i am trying to start talend but it throws error:


"The Studio does not support Java 8. Java 7 is the recommended JVM version to be used"

Now how to start Talend on machine if both java version is installed on your machine

Solution

As Talend the version i am using is not supportable on java 8, so i need to start talend through cmd assigning it java 7, so that it can start, let's use below commands and see if it works or not.
  • Open Cmd
  • Move to installed directory of Talend and run below command
  • TOS_DI-win32-x86.exe -vm "C:\Program Files (x86)\Java\jdk1.7.0_65\bin"

web stats