- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Number conversion
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 04:39 AM
тАО12-14-2010 04:39 AM
My flat file contains data like:
---------------------------------------
0 90 0 0 0 512000 7
0 0 30 0 0 6.29146e+06 30
in the above data all the columns are numbers only. But From the source file we are receiving data in the sixth column in exponential format (which is out of control from us) now I need to convert this into number and load into table (Because my Table column data type is number).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 05:16 AM
тАО12-14-2010 05:16 AM
Re: Number conversion
If this is a table in a database, what's the name and version of the database engine? (Oracle 10g? MySQL 5.1? Something else?)
In general, I'd search the database documentation for functions like TO_NUMBER(), CONVERT() or CAST(). Without knowing the name of the database engine, it is hard to be more specific.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 05:18 AM
тАО12-14-2010 05:18 AM
Re: Number conversion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 06:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 06:13 AM
тАО12-14-2010 06:13 AM
Re: Number conversion
You also have unevaluated (answers without points assigned) an your earlier threads:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1458759
When you are satisfied with the help that you have received, please read this link about points assignments:
http://forums.itrc.hp.com/service/forums/helptips.do?#28
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 06:19 AM
тАО12-14-2010 06:19 AM
Re: Number conversion
..
Sure from nowonwards I will try to assign the points aswell.
As I am new to this forum, I dont know the benifits for assign points.
Anyways thanQ... :-)
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 06:31 AM
тАО12-14-2010 06:31 AM
Re: Number conversion
> Sure from nowonwards I will try to assign the points aswell.
Thanks. You can go back (using your profile) and find those threads where you didn't assign points and evaluate those too.
The value to assigning points is two-fold: (1) to say "thanks"; and (2) to flag the discussion and its contributions for future viewers to find what solved *your* problem and therefore what might be helpful to them.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2010 07:34 AM
тАО12-14-2010 07:34 AM
Re: Number conversion
Oops, the original post I made failed to cover cases like "3e+3" (without a fractional part). Use:
# perl -ne 's{(\d+(?:\.\d+)?[eE][+-]\d+)}{sprintf "%.0f",$1}ge;print' file
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2010 12:32 AM
тАО12-15-2010 12:32 AM
Re: Number conversion
awk '
BEGIN { OFMT="%.0f" }
{
for (i=1; i < NF; ++i)
printf "%.0f ", $i
print $NF
} ' file
- Tags:
- awk