[Solved] Easy Way to Convert descript.ion file to Formated Text File?

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
brahman
Member
Member
Posts: 146
Joined: 2006-04-26, 13:27 UTC

[Solved] Easy Way to Convert descript.ion file to Formated Text File?

Post by *brahman » 2019-11-06, 16:58 UTC

Hello,

would anyone know of an easy and free way to convert a descript.ion file to a text file with proper line end formatting instead of all the /n stuff which I am seeing right now, when I simply rename the .ion file to a .txt file?

Thanks!
Last edited by brahman on 2019-11-08, 18:05 UTC, edited 1 time in total.
Regards, Brahman
Win10 Pro x64

User avatar
petermad
Power Member
Power Member
Posts: 9002
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *petermad » 2019-11-06, 17:16 UTC

The encoding of the descript.ion file depends on your setting of "Configuration" -> "Options..." -> "Operation" -> "File comments:" -> "Preferred type:"

But no matter which encoding that is used, line shifts should not be shown as /n if you open the file in Notepad or other real text editors. Which editor are you opening your file with?
License #524 (1994)
Danish Total Commander Translator
TC 9.5b9 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

brahman
Member
Member
Posts: 146
Joined: 2006-04-26, 13:27 UTC

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *brahman » 2019-11-06, 17:33 UTC

"Plain Text + UTF16"

Interesting, I remembered that one could only choose between descript.ion and files.bbs, now I was surprised to see all the additional options.

I work a lot with descript.ion files, and I am concerned that should I change the settings, my old files are not correctly processed any longer.
Regards, Brahman
Win10 Pro x64

User avatar
Hacker
Moderator
Moderator
Posts: 11405
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *Hacker » 2019-11-06, 19:44 UTC

petermad,
line shifts should not be shown as /n
Umm, they should?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

User avatar
HolgerK
Power Member
Power Member
Posts: 5166
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *HolgerK » 2019-11-06, 20:18 UTC

Hacker wrote:
2019-11-06, 19:44 UTC
petermad,
line shifts should not be shown as /n
Umm, they should?

Roman
\n
?;-)
Holger
Make our planet great again

User avatar
Hacker
Moderator
Moderator
Posts: 11405
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *Hacker » 2019-11-06, 20:58 UTC

HolgerK,
Well, yes, but I don't think petermad wanted to point that out.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

User avatar
petermad
Power Member
Power Member
Posts: 9002
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *petermad » 2019-11-06, 21:13 UTC

Well, yes, but I don't think petermad wanted to point that out.
You are right - I meant that lineshifts are shown as lineshifts not as unformatted \n code, when I open descript.ion in Notepad
License #524 (1994)
Danish Total Commander Translator
TC 9.5b9 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
HolgerK
Power Member
Power Member
Posts: 5166
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *HolgerK » 2019-11-06, 21:40 UTC

DESCRIPT.ION has one line per file, and is unsorted. Each line is in the following format:

filename.ext Description[*<ID>Other program info]...<CR><LF>
https://web.archive.org/web/20160318122322/https://jpsoft.com/ascii/descfile.txt
Show
JP Software Inc.
P.O. Box 328
Chestertown, MD 21620, USA

410-810-8818
fax 410-810-0026
Email sales(at)jpsoft.com
Web http://www.jpsoft.com/

Technical Note -- Using DESCRIPT.ION
------------------------------------

4NT and Take Command use the file DESCRIPT.ION to store file descriptions.
This file is created as a hidden file in each subdirectory which has
descriptions, and deleted when all descriptions are removed or when all
files with descriptions are deleted. If you remove the hidden attribute
from the file, it will not be hidden again.

Your programs can access DESCRIPT.ION to create, retrieve, or modify
file descriptions, and to store other information. DESCRIPT.ION has one
line per file, and is unsorted. Each line is in the following format:

filename.ext Description[*<ID>Other program info]...<CR><LF>

There is normally one space between the description and filename but
additional spaces may be used in future versions. The characters
after the description allow extension of the description format
for use by other programs. They are as follows:

* is an ASCII Ctrl-D (04), and marks the end of the description
text and the beginning of information for a program other than
4NT or Take Command. This symbol can appear multiple times on each
line; each occurrence marks the beginning of information for another
program.

<ID> is an identification byte for the program which is using this
area of the particular line. If you are writing a program which
will store information in DESCRIPT.ION, test it using an ID byte of
your own choosing. When you are ready to release the program,
contact JP Software and we will provide you with an ID byte value
that is not in use by others to the best of our knowledge.

Other program info is any text the program wishes to store in its
area of the line. The text should relate specifically to the file
named on the line. It may not contain the Ctrl-D character,
carriage returns, line feeds, or nulls (ASCII 0s).

4NT and Take Command will copy, delete, or move all the information on a
line in DESCRIPT.ION, including information owned by other programs, when
performing the same action on the corresponding file. They will also
change the name if a file is renamed. To support DESCRIPT.ION properly,
your program must do the same if it copies, deletes, moves, or renames
files. Take care not to remove information which does not belong to
your program, or delete lines which contain information for other
programs. Your program should be able to handle a line terminated by a
CR or LF alone, a CR/LF pair, an EOF (ASCII 26), or the physical end of
the file. The lines it creates should be terminated with CR / LF. The
line length limit is 4096 bytes; exceeding this limit will cause
unpredictable results.

=======================================================================
JP Software Inc. P.O. Box 328, Chestertown, MD 21620, USA
phone: 410-810-8818 fax: 410-810-0026
WWW: http://jpsoft.com email: sales(at)jpsoft.com
\n is only used for multi line comments.
Remember each comment for a single file is represented in a single line terminated with:
Your program should be able to handle a line terminated by a
CR or LF alone, a CR/LF pair, an EOF (ASCII 26), or the physical end of
the file. The lines it creates should be terminated with CR / LF. The
line length limit is 4096 bytes; exceeding this limit will cause
unpredictable results.
Which means that CR, LF,.. has to be replaced with a placeholder (\n) inside a multi line comment.

Regards
Holger
Make our planet great again

User avatar
petermad
Power Member
Power Member
Posts: 9002
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *petermad » 2019-11-07, 02:39 UTC

Ahh, yes - multiline descriptions uses some formatting code.

You can search and replace first all occurrences of \n and then all of  (04 C2) - maybe automate with an editor that can run macros.
License #524 (1994)
Danish Total Commander Translator
TC 9.5b9 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

brahman
Member
Member
Posts: 146
Joined: 2006-04-26, 13:27 UTC

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *brahman » 2019-11-07, 19:22 UTC

Yes of course I meant \n - thank you for pointing that out! :)

I tried to do a search and replace with Notepad++, and it was just an epic fail.

Maybe I did something wrong.

One used to need all these skills, but now Windows 10 got so easy, that all those tinkering skills hardly get used any more and one forgets how one managed to do all these things years back.

Anyway - as my original question was: Is there an easy way to do this?
Regards, Brahman
Win10 Pro x64

User avatar
Stefan2
Power Member
Power Member
Posts: 2676
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Convert descript.ion file "\n line break" to formated Text File

Post by *Stefan2 » 2019-11-07, 21:48 UTC

brahman wrote:
2019-11-06, 16:58 UTC
would anyone know of an easy and free way to convert a descript.ion file to a text file
with proper line end formatting instead of all the \n stuff
which I am seeing right now, when I simply rename the .ion file to a .txt file?


To replace "\n" text sign to actual real line break, use in Notepad++
Search for: \\n
Replace with: \r\n
(o) Regular expression



Since we use RegEx to be able to replace by a line break (\r\n),
we have to escape the char "\" of the literal "\n" by doubling it to "\\" (because it is a RegEx meta char).

If you don't need RegEx at all (f.ex. just replacing "\n" by e.g. "#" or an space), you can search for literal "\n" without doubling .




HTH? :D
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

User avatar
petermad
Power Member
Power Member
Posts: 9002
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *petermad » 2019-11-08, 00:46 UTC

I tried to do a search and replace with Notepad++, and it was just an epic fail.
I tried with plain Notepad - that worked fine (I converted \n to a space).
License #524 (1994)
Danish Total Commander Translator
TC 9.5b9 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

brahman
Member
Member
Posts: 146
Joined: 2006-04-26, 13:27 UTC

Re: Easy Way to Convert descript.ion file to Formated Text File?

Post by *brahman » 2019-11-08, 18:03 UTC

Thank you very much, everyone!

You have all been very helpful and I finally used Stefan2's solution with great success!
Regards, Brahman
Win10 Pro x64

Post Reply