Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: PS Script to generate .txt from .docx and .doc #114

Merged
merged 3 commits into from
Jul 8, 2020
Merged

Conversation

wlawt
Copy link
Contributor

@wlawt wlawt commented Jul 6, 2020

This PR focuses on creating a Powershell (PS) script (generate_txt.ps1) that will open up all the test_files files and save them as plain text .txt

At the moment, currently supports .doc .docx.

To run this script:

  1. Run Set-ExecutionPolicy RemoteSigned OR Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass in PS Admin 7.0
  2. Close and rerun PS Admin 7.0
  3. Have the PS script in the root of the repo
  4. Run .\generate_txt.ps1 .\test_files\EXT_TYPE\FOLDER (ex. .\generate_txt.ps1 .\test_files\docx\apachepoi)

If you need to generate more plain text files:

  1. Run the script
  2. If the script requires a password you'll have to uncomment L27-29 and comment L26 and run the script
  3. Finally, undo step 2

Results that you should be seeing:

  • Word should be opening and closing (to grab and save the contents as .txt)
  • There should be .txt files being generated in the same folder that you ran the script

Other edge cases to consider:

  • The script will fail for documents that are broken (Word will prompt a notification to handle this)

@reviewher reviewher requested a review from garrettluu July 6, 2020 23:34
@SheetJSDev
Copy link
Contributor

Can you put the instructions for running the script somewhere in the repo (either as a section in the README.md or in a separate notes file)?

Copy link
Contributor

@garrettluu garrettluu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good to me!

generate_txt.ps1 Show resolved Hide resolved
generate_txt.ps1 Outdated Show resolved Hide resolved
@wlawt wlawt merged commit 5163023 into master Jul 8, 2020
@wlawt wlawt deleted the powershell-script branch July 8, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants