Page 1 of 1

Convert Scientific notation number to expanded form

Posted: Fri Jun 24, 2016 10:35 am
by DataMystic Support
Here is a simple filter that converts numbers of the form

Code: Select all

138E3
to

Code: Select all

138000
(note: It doesn't work for negative values)

It's designed to work with the data in CSV field 1.

Code: Select all

Restrict fields:1 Comma-delimited fields starting at field 1
|  [X] Process fields individually
|    [X] Exclude delimiter
|      [X] Exclude quotes (if present)
|  Delimiter Type: 0
|  Custom delimiter: 
|  [ ] Has Header
|
+--EasyPattern [E[ capture( longest 1+ digits ) ]] with [$1]
   |  [X] Match case
   |  [ ] Whole words only
   |  [ ] Case sensitive replace
   |  [ ] Prompt on replace
   |  [ ] Skip prompt if identical
   |  [ ] First only
   |  [ ] Extract matches
   |  Maximum text buffer size 4096
   |
   +--VBScript script  Timeout: 10000 milliseconds
         'This example script keeps a line counter that 
         'does not reset for each file
         
         'Our line counter
         dim zeroes
         
         'Called for every line in the file
         'EOL contains the end of line characters (Unix, DOS or Mac) that must be
         'appended to each line
         function processLine(count, EOL)
         
           zeroes = ""
           for i = 1 to count
           	zeroes = zeroes + "0"
           next
           
           processLine = zeroes & EOL
         end function
         
         
         sub startJob()
         end sub
         
         
         sub endJob()
           'do nothing
         end sub
         
         
         function startFile()
           startFile = ""
         end function
         
         
         function endFile()
           endFile = ""
         end function