| | |
how to sort a big data using c++
![]() |
•
•
Join Date: Dec 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi all, I have a problem in sorting a fortran data and I don't know fortran. Its quite big data and its not in column arrangement. the sample is below :
3.900000000E 2.180E 0.000E 2.653E 1.763E2.339E-01 0.000 0.6983 0.2814 0.0001 0.0080 0.0067 0.0019 0.0007 0.0000 -3.6431 1.4826 7.3919
7.476000000E 5.000E 0.000E 1.405E 3.831E-25 1.496E-01 0.000 0.6983 0.2814 0.0001 0.0080 0.0067 0.0019 0.0007 0.0000 -3.6431 1.4826 7.3919
-1.000000000E 6.000E-01 0.000E 1.473E 0.000E 1.496E-01 0.000 0.6985 0.2814 0.0035 0.0010 0.0101 0.0019 0.0007 1.0000-16.9609 -9.1006 4.1354
1.000000000E 0.000E 0.000E 0.000E 7.384E-07 0.000E 0.00000 0.000 0.874 3.900 3.900 3.900 3.900 -9.046 1.61923 0.3449 2.1845
1.370727360E7.113E 0.000E 0.000E 0.000E 1.220E-21 2.113 0.867 3.900 3.900 3.900 3.900 0.000 0.049 0.324 -0.141 -0.477
Those are 1 set of 88 different numbers and there are 663 different set. How can I sort these huge set of numbers into 88 column. I attached 1 page of the data if you guys out there kindly want to help me sort these numbers.
Thank you.
3.900000000E 2.180E 0.000E 2.653E 1.763E2.339E-01 0.000 0.6983 0.2814 0.0001 0.0080 0.0067 0.0019 0.0007 0.0000 -3.6431 1.4826 7.3919
7.476000000E 5.000E 0.000E 1.405E 3.831E-25 1.496E-01 0.000 0.6983 0.2814 0.0001 0.0080 0.0067 0.0019 0.0007 0.0000 -3.6431 1.4826 7.3919
-1.000000000E 6.000E-01 0.000E 1.473E 0.000E 1.496E-01 0.000 0.6985 0.2814 0.0035 0.0010 0.0101 0.0019 0.0007 1.0000-16.9609 -9.1006 4.1354
1.000000000E 0.000E 0.000E 0.000E 7.384E-07 0.000E 0.00000 0.000 0.874 3.900 3.900 3.900 3.900 -9.046 1.61923 0.3449 2.1845
1.370727360E7.113E 0.000E 0.000E 0.000E 1.220E-21 2.113 0.867 3.900 3.900 3.900 3.900 0.000 0.049 0.324 -0.141 -0.477
Those are 1 set of 88 different numbers and there are 663 different set. How can I sort these huge set of numbers into 88 column. I attached 1 page of the data if you guys out there kindly want to help me sort these numbers.
Thank you.
0
#2 Dec 3rd, 2009
first of all I have a bad feeling about this. because the algorithm that I will
suggest will be not complete in the polynomial time.
So dataset like this , you need to scan for it. For that you can simply use
the regex libraries ( whatever supported in you're plactform ). and that's
the easy way , but it will take a long time.
The second option is use a lex like tool to generate the code for a
lexer to scan these numbers that contain different formats.
In windows environment this tool was named as flex.
http://gnuwin32.sourceforge.net/packages/flex.htm
is their project page. and google around , there are some examples
to do something like that , with auto generated scanner code.
but if you using the regex libraries instead, then I can't guarantee that algorithm will end up in the polynomial time.
best regards
suggest will be not complete in the polynomial time.
So dataset like this , you need to scan for it. For that you can simply use
the regex libraries ( whatever supported in you're plactform ). and that's
the easy way , but it will take a long time.
The second option is use a lex like tool to generate the code for a
lexer to scan these numbers that contain different formats.
In windows environment this tool was named as flex.
http://gnuwin32.sourceforge.net/packages/flex.htm
is their project page. and google around , there are some examples
to do something like that , with auto generated scanner code.
but if you using the regex libraries instead, then I can't guarantee that algorithm will end up in the polynomial time.
best regards
Nothing like a kernel pannic !
![]() |
Similar Threads
- [HELP] how to sort the data + make the information.txt more neatly (C++)
- VB6 Database Program (Visual Basic 4 / 5 / 6)
- Sort/Filter Data in generic collection (C#)
- sort multi-dimension data by one coulmn (Python)
- Sort a dynamic array of structs (Visual Basic 4 / 5 / 6)
- Why Data Structures???...QUESTIONS INSIDE (C++)
- Quicksort/Insertion sort Hyrbid? (C)
- How to sort the rows in the datagrid and update it successfully? (VB.NET)
Other Threads in the C++ Forum
- Previous Thread: C++ and mysql
- Next Thread: Memory management simulator
Views: 288 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 algorithm array arrays assignment beginner binary c++ c/c++ calculator char class classes code compile compiler constructor conversion convert count delete dll dynamic encryption error exception file files filestream forms fstream function functions game givemetehcodez graph graphics gui helpwithhomework homework iamthwee input int lazy link linked-list linker list loop looping loops math matrix member memory newbie number object objects opengl output parameter path pointer pointers problem program programming project python random read reading recursion recursive reference search sort spoonfeeding string strings struct student studio template templates text time tree url variable vc++ vector video visual win32 window windows winsock wxwidgets





