Hi I kind of asked this before but it was in one of my unrelated threads.. How can I manipulate a point file (sta,offset,elev) to how I need it?
The point file comes in like this in a word doc or a .txt
000
-0.36 1276.41
-0.00 1276.50
0.33 1276.42
005
-0.33 1276.42
-0.00 1276.50
0.19 1276.45
010
-0.02 1276.50
-0.00 1276.50
0.04 1276.51
____________________________________
I need it too looke like this:
000,-0.36,1276.41
000,-0.00,1276.50
000,0.33,1276.42
005,-0.33,1276.42
005,-0.00,1276.50
005,0.19,1276.45
etc...
I did the other ones by hand because they were only a few pages, but this one is about 500 pages I think.. before I had responses about parsing it but I tryed and I had no idea what I was doing or how to run it..
Thanks
It's very easy using MS Excel to get that into a comma separated file. Getting the stations in front of all of the points will need to be done manually using copy paste or Auto-Fill dragging. Unless someone has a better idea.
Thanks for your email, we added this tool to MapWorks.
The approach we took was to allow a field delimiter and in the case of spaces (like this one) allow the user to specify the order with instant visual feedback of the extents (see the attachment below). Of course the coordinates will differ as we used a randomly generated alignment.
Hi Terry, that program looks awesome and it looks like it would be easy to use and give good results
Here's how to do it, using the same method as I used last time. I took the Perl script I used the last time you asked a question like this, and modified it to work with this format. I've attached a zip file that includes the Perl script, along with the output file it created.
If you've ever used regular expressions, Perl is pretty easy to use. It's a lot like AWK, except you can also use variables and commands, to do even more elaborate things. It basically lets you loop on an input file, using regular expressions to parse the input, then you can modify that data however you wish, and send it to an output file.