Sign in to follow this  
brucek

Off Topic (almost)- question on exporting .xls files ba

Recommended Posts

I have imported a flightplan.txt file to Excel (comma delim) for sorting, but can't recall how to convert it back to text format. Can anyone help?They tell me the mind is the first to go, now I believe it :)Thanks,Bruce.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Don't forget you have to change the tabs from the "save as" file back into comma's.Also make sure you don't have extra comma's at the end of the line.Rgds Ron

Share this post


Link to post
Share on other sites

resurrecting this subject ....How do you stop the 'extra' commas?Here is what I do:Rename the .TXT file to .CSV, process my changes in Excel (mainly the % field), re-save as a .CSV (both with a 'Yes' and a 'No' click), re-name the .CSV to .TXT and I always get extra commas if some cells are blank. No matter what I have tried to do I can't get rid of the little devils - and of course TTools won't compile the FlightPlans.TXT file then will it!Peter Leadbeater,Air Pierre, Warrington, UK.

Share this post


Link to post
Share on other sites

It's all normal. Think about it. If you have 10 different cells per line, it puts commas between all the cells. If the cells are empty, it will look as if you have a bunch of commas together. But they're needed, so that when you re-import it in Excel, it knows which cells are empty and which are not (it basically counts the commas).As far as TTools is concerned, why do you even have blank cells ? If my memory serves me right, you need to have something in all the fields. I don't think TTools adds a "default value" when no info is found...__________________________________________________________EricList of all airlines, aircraft manufacturers and aircraft types recognised by ATC:http://www.geocities.com/eric_2203/orhttp://ftp.avsim.com/library/esearch.php?D...atID=fs2002misc

Share this post


Link to post
Share on other sites

Hi Eric,>It's all normal. Think about it.I have done nothing else whilst trying to solve the problem!!>As far as TTools is concerned, why do you even have blank >cells ? If my memory serves me right, you need to have >something in all the fields. I don't think TTools adds a >"default value" when no info is found... Here is an example of how you get 'blank' cells when a TXT file is coverted to then from a CSV:-AC#907,SN146,3%,24Hr,IFR,05:55:00,00:00:00,290,F,2060,EBBR,10:25:00,00:00:00,350,F,2413,EHAM,11:40:00,00:00:00,390,F,2414,EBBR,14:00:00,00:00:00,310,F,2055,EGGDAC#907,SN146,4%,24Hr,IFR,06:25:00,00:00:00,330,F,2641,EDDM,17:25:00,00:00:00,390,F,2648,EBBRYou will see that the first set of data has more than one set of 'legs' compared to the second set!No nearer a solution - if there is one at all are we?Thanks for your reply though ...Peter Leadbeater,Air Pierre, Warrington, UK.

Share this post


Link to post
Share on other sites

Ok... I forgot about the legs... I haven't used TTools in a long time. Thing is, your "empty cells" are in effect at the end of the lines. Never in the middle. So removing all the commas you may find at the end of each line should solve the problem, shouldn't it ? Unfortunately that would have to be done manually.What you could do - if you know how - would be to make a little program in VB (for example) that deletes commas at the end of lines. Could perhaps even be done with the VB for Applications that comes with Excel. Well just a thought.__________________________________________________________EricList of all airlines, aircraft manufacturers and aircraft types recognised by ATC:http://www.geocities.com/eric_2203/orhttp://ftp.avsim.com/library/esearch.php?D...atID=fs2002misc

Share this post


Link to post
Share on other sites

Windows front ends like yRoute and AITM will sort your flights for you. Not in the flightplans.txt file itself, but right on the screen - just as easy to use too. If you don't like their compile routines (AITM loves to remove flights, for example, with no way to avoid it without fixing the flights AFAIK), you can use them to edit your plans, and then save them. Then copy and compile in TTools as usual.Hope this helps,-- Tom GibsonCalifornia Classic Propliners: http://www.calclassic.com/Cal Classic Alco Page: http://www.calclassic.com/alco/Freeflight Design Shop: http://www.freeflightdesign.com/ San Diego Model RR Museum: http://www.sdmodelrailroadm.com/Drop by! ___x_x_(")_x_x___

Share this post


Link to post
Share on other sites

I must have been tired when I wrote that last night, as there are other simpler ways to get rid of the commas.If you have Word, open your text file and perform a Replace on ",^p" (without the quotes). Replace that by "^p" (without the quotes). The ^p means paragraph mark (or end of a line if you prefer). Execute that replacement until the number of replacements goes down to zero and all trailing commas will be gone.Another way would be to create several worksheets in your Excel workbook. One sheet for 2-leg flight plans (going and coming back), one sheet for 3-leg flight plans, one for 4-leg flight plans... etc. That way, you won't have empty cells. Save each of the sheet as CSV files separately (you have to do it this way anyway, you can't save all worksheets at once in CSV format). That way, none of them will have trailing commas. After that, just merge them by pasting the contents of every CSV files in one big TXT file, one after the other.__________________________________________________________EricList of all airlines, aircraft manufacturers and aircraft types recognised by ATC:http://www.geocities.com/eric_2203/orhttp://ftp.avsim.com/library/esearch.php?D...atID=fs2002misc

Share this post


Link to post
Share on other sites

Thanks Tom,I'll try those front-end apps, I still have yet to see how they work.Bruce.

Share this post


Link to post
Share on other sites

Here is how I get rid of my commasOnce you have the final product in text format with the extra commas, do a find and replace for the following:find:,,,,,,replace with:,next-find:,,,,,replace with:,next-find:,,,,replace with:,next-find:,,,replace with:,next-find:,,replace with:,This will leave you with one comma at the end of the flightplans where there used to be many. TTools will accept 1 comma at the end of the flightplan. You might have to repeat the last step a couple of times clear out a few stragglers.The whole process takes me about one extra minute. On a slower system it might take a bit longer to check the flightplans. To speed the process up, sort the flightplans by length (number of cells) before you leave excel. Longest at the top. Is there a program out there that would give me the ability to copy and paste the way you can in excel and handle the flightplans more efficiently? JeffDetroit, MI USAAMD Athlon XP2000Windows XP 768MB DDR pc2700 ramMSI KT3 Ultra VisionTek gforce 3 ti500

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this