Date: prev next · Thread: first prev next last
2020 Archives by date, by thread · List index


=The solution to modify the data to time format with special edit option 
was really nice, but not sure how much work would be required to 
modify it. Tried to do it directly in other ways, but couldn't do it, and 
from feedback it seems it is no longer possible since libreoffice doesn't 
support the formula..
Created test file with 1000 GPS addresses with randon values with 
libreoffice to a text file. Original setup has each on separte line.
sed process does the 1000 items in 0.048 seconds.Then converted same data to 500 lines with 2 sets 
of GPS addresses per 
line. Then wrote singlec++ program to process 500 lines of data.
Time: 0.005s.


So, guess there are different methods to solve the problem.
If anyone interested, can send the simple c++ program. Only little issue, 
was the the degree code that was in orginal posted data was a two byte 
version. Had to add a line of code to handle either single or double byte 
coding of that. In the sed solution, I had pasted the symbol, so didn't see 
issue, but in the c++ put the hex value. If anyone wants code, just send 
me an email..


Not really of any interest to me, since I don't have anything that deals 
with GPS or Digital address data. But don't like not being able to solve 
interesting problems. Thanks for the time, and hope this thread wasn't to 
much trouble to some..


Be Safe and Have a Great Day...


Sed Process that produces output of 1000 data points to 500 sets.
time ./gpssed.sh


real0m0.048s
user0m0.016s
sys0m0.019s
input first 8 lines (makes 4 pairs)
8377'73N
419'9E
1562'44S
3442'82O
6683'98N
579'22E
6130'46S
2028'78O
First 4 sets from gpsbc.csv GPS 1, Data 1, GPS 2, Data 
28377'73N,84.30361111111111111110,419'9=E,41.15250000000000000000
1562'44S,-16.04555555555555555555,3442'82O,-34.72277777777777777777
6683'98N,67.41055555555555555555,579'22E,6.32277777777777777777
6130'46S,-61.51277777777777777777,2028'78O,-20.48833333333333333332




sed -e 's/^/=(/;s/\/+/;s/\x27/\/60+/;s/\x22/\/3600/;s/O\|S/\)*(-1)/;s/N\|E/)/'gps.txtgps.csv
sed -e 's/^/(/;s/\/+/;s/\x27/\/60+/;s/\x22/\/3600/;s/O\|S/\)*(-1)/;s/N\|E/)/'gps.txtgps.raw
paste -d, gps.txt gps.csvgpsboth.csv</div>bc -lgps.rawgps2.txt
paste -d, gps.txt gps2.txt |awk '{line=line,t;$0} NR%2==0{print line;line=}'| sed -e 
's/^,//g'gpsbc.csv
if [ -n$1] ; then libreoffice --infilter=CSV:44,34,76,1 gps.csv gpsboth.csv gpsbc.csv ; fi


// Then decided to try to do it with a simple C++ program.
// Amost 10 times faster with 500 pairs of address to original format of data.
/* gpsc3.sh
./gpsc3
if [ -n$1] ; then libreoffice --infilter=CSV:44,34,76,1 gpsc3.csv; fi


Time less libreoffice line.
time ./gpsc3
real0m0.005s
user0m0.003s
sys0m0.002s


Input file lines with pairs of address (first 4 lines)</span>
8377'73N 419'9E1562'44S 3442'82O</div>6683'98N 579'22E6130'46S 2028'78O</div>Output file
8377'73N 419'9E; ,84.30361176,41.15250015
1562'44S 3442'82O, -16.04555511, -34.72277832
6683'98N 579'22E,&#
-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.