How to handle text efficiently in scripts cmd windows

0

I'm looking for a way to manipulate a text file using a batch file script (.bat)

Apparently cmd does not have much power for these tasks, so I have been doing some research on the Internet and I have found some things that I do not understand.

Apparently there is a component in windows that allows executing certain commands or commands from other scripting languages of the .NET platform such as VBscript or Javascript from windows cmd.

The question in itself is that all the information that I have been able to compile is diffuse and incomplete and I am a bit lost about what tools I should learn to use in order to manage text files efficiently with things that come natively with windows (no I can install anything or add any new component that is not already in the system itself).

I expose the concepts that I have been able to find: "WScript Object", "FileSystemObject" and "COM Objects in Windows Script Host".

Although I'm a little familiar, I'm relatively new in object-oriented languages, I've only seen a bit of .NET and I'm still a newbie in all of this.

In summary, I would like to know what tools / language / resources I would need to be able to complete my cmd scripts, adding the ability to read, write, and edit plain text files efficiently.

Greetings.

    
asked by tHe_sHayKo 17.05.2018 в 13:46
source

1 answer

0

Unfortunately the Windows CMD is not very program oriented. And things as simple as what you need are quite complicated to perform. If you need to apply filters or modify content, you can use the port of SED for Windows.

  

Sed (sequence editor) is not really a true text editor or word processor. Instead, it is used to filter text, that is, it takes text input and performs some operation (or set of operations) on it and issues the modified text. Thirst is generally used to extract part of a file using matching patterns or replacing multiple occurrences of a string within a file.

If the treatment you need is more advanced, I recommend you use a scripting language ( VBScript , JScript ) or some interpreted language ( Python ).

I personally use Python for any advanced scripting needs you may have.

    
answered by 17.05.2018 в 17:32