MPLAB Tab Sizes

Status
Not open for further replies.

Gayan Soyza

Active Member
When I want to do a new project I'm going through the project wizard & creating a new project.So all the files in a single folder.

My problem is when I need to copy this asm file to a website or write to a CD the alignments (tab sizes) are messed up.So again from the beginning I have to re-indent line by line.

Any method to copy this asm file to another location without messing up the tab sizes?
 
Here's a little perl script I wrote way back to strip tabs and replace with spaces. I've turned it into a EXE file so you don't need perl installed to run it, but you do need to run it from a DOS window

**broken link removed**

Run it from a command line prompt - the number (16 in the example) is the tab setting in the original file, you need to set this to suit - I can't remember if MPLAB defaults to 14 or 16 for the tab setting.

detab.exe 16 myprog.asm myprog.txt
 
Last edited:
Hi geko long time back after the knight rider discussion. Thanks for your soft.

Now I checking to run it.Does the files need to be in the same folder = detab+asm file?

One check it says you have typed incorrectly

C:\Documents and Settings\Gayan\Desktop\New\detab.exe 12 Light Controller.ASM Light Controller.txt
 
Last edited:

No but you'll have to enter the file path so it's easier if they are.
 
Just rename your asm file without any spaces in the filenames, it's not a windows app and it uses spaces to delimit the fields
 
Is this ok?

C:\Documents and Settings\Gayan\Desktop\New\detab.exe space 12 space Light.ASM space Light.txt
 
This part is working perfectly.

C:\Documents and Settings\Gayan\Desktop\New\detab.exe working perfectly.

When I enter the asm files it won't work.
 
C:\Documents and Settings\Gayan\Desktop\New\detab.exe 12 Light.asm Light.txt
 

Attachments

  • Error..PNG
    12.2 KB · Views: 167
Last edited:
You need to open a DOS command window - Start - Run - CMD

Then CD into the directory and run from there, I usually just dump a copy of the asm file into the root of C then run it from there since it saves typing a long path, but works from anywhere.

C:\Documents and Settings\pete\Desktop\pete>detab.exe 16 3chlrnrem.asm test.txt
C:\Documents and Settings\pete\Desktop\pete>dir
Volume in drive C has no label.
Volume Serial Number is B806-9273
Directory of C:\Documents and Settings\pete\Desktop\pete
22/02/2010 09:15 <DIR> .
22/02/2010 09:15 <DIR> ..
22/02/2010 08:55 34,092 3chLrnRem.asm
02/02/2010 08:30 540,758 detab.exe
22/02/2010 09:15 41,430 test.txt
3 File(s) 616,280 bytes
2 Dir(s) 52,396,257,280 bytes free
C:\Documents and Settings\pete\Desktop\pete>
 
Any chance to make renaming automatic?

Hola Pete,

I am not at my PC right now.

Trying to avoid the eventual mistakes of the manual process, is it any chance to have detab.exe xx doing the renaming of test.txt as 3chlrnrem.asm once finished? I am affraid that currently there is not...
 
Last edited:
Hola Pete,

I am not at my PC right now.

Trying to avoid the eventual mistakes of the manual process, is it any chance to have detab.exe xx doing the renaming of test.txt as 3chlrnrem.asm once finished? I am affraid that currently there is not...

Modified as requested

**broken link removed**

*** De-Tabify text file utility ***
---------------------------------------------------------
Utility to remove tab characters from file and substitute
with spaces at a user specified interval.
Useage: detab.exe tabs source_file [-f]
tabs specifies tab stop position for original file
source specifies source file name
-f option saves output to source filename,
otherwise output is written to STDOUT
example:
detab.exe 16 myprog.asm -f

One reason I didn't do it this way in the original version is that if you get the tab setting wrong, you can't change it because the tabs are now spaces and the source file has been overwritten.


 
Last edited:
Thanks for that, Pete.

Impressive! Quick response.

Gracias Pete!
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…