write net :
- Vote on answer
- posted
19 years ago
write net :
oops...
Walter is absolutely correct
You can use MS Wordpad or Word or a number of other utility that will allow you to edit the file and or save it in MS-DOS format
Is there a way to save the PIX configuration (via TFTP) directly in MS-DOS format?
Thanks, Alex.
As noted you can read these files with wordpad or word. You can then copy the text out, paste it into notepad and save.
There is a trivial command line method of converting them in windows using standard tools which has the minor side effect of adding the file name and a few other bits to the top of the file. This may or may not be critical to your needs.
S:\\>find /v "some-random-text" fred.txt > fred2.txt
Where "some-random-text" is *not* present in the file.
This also converts Unicode files to Ascii files which is what I was looking for when I found it. 'cos it seemed too hard for me in perl.
S:\\>type fred.txt lineone linetwo
S:\\>debug fred.txt
-d
6C 69 6E 65 6F 6E 65 0A-6C 69 6E 65 74 77 6F 0A lineone.linetwo.## Note 0A - Unix line end - I think I got that right?
S:\\>find /v "qweiouoriuew" fred.txt > fred2.txt
S:\\>debug fred2.txt
-d
0D 0A 2D 2D 2D 2D 2D 2D-2D 2D 2D 2D 20 46 52 45 ..---------- FRE 44 2E 54 58 54 0D 0A 6C-69 6E 65 6F 6E 65 0D 0A D.TXT..lineone.. 6C 69 6E 65 74 77 6F 0D-0A 26 04 F0 02 04 04 FB linetwo..&......## note 0D 0A - DOS line end
Clearly this would be easy in perl (for someone who knew what they were doing) but I don't have anything done.
- - - Loading them into DOS Edit (yes it still is there in XP I just found out) and just choosing file save does the trick.
Lets just check that it is really in XP - kind of. S:\\>which edit.exe which: no edit.exe in (C:\\Program Files\\Windows Resource Kits\\Tools\\;C:\\Tcl\\bin;C:\\Perl\\bin\\; C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem; c:\\unixtools;C:\\Program Files\\Support Tools\\)
Hmmmmm!
S:\\>which edit.com C:\\WINDOWS\\system32\\edit.com
Well well well, a .com file apparently still shipping with XP.
In article , AM wrote: :Is there a way to save the PIX configuration (via TFTP) directly in MS-DOS format?
I don't believe so, no. tftp is a binary transfer format, so you will end up with a newline-delimited output file rather than with automatic conversion to carriage-return newline.
There should be fairly small programs available that do the transformation.
Also, it is plausible that there might be tftp servers which recognize the file as being pure text and do the transformation. I don't know of any. More likely would be a tftp server which recognized a certain file extension (e.g., .txt) and used that as a signal to do newline conversion.
So I guess it is time to ask the obvious question - what is it that you are trying to accomplish ?
Is it toto save the config with pre-shared keys and password being in clear text ???
If so write net does htat. You just need to be aware as Walter pointed out that the file is written with UNIX-stle end of line character sequence.
OPening it with wordpad and then resaving it will convert it to the equivalent of MS-DOS format
I'm using tftpd32 (Cisco recommended it). I can also do a "wr term" and do a cut and paste but pre-shared keys are not shown. Do you a tftp server as tiny as tftpd32? with the feature in the subject, obviously.
Alex.
Just save time with less steps for the same job.
Yes so I can load config file without storing preshared information in only one location.
Alex.
Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.