- Details
- Category: Generalia
I recently started using OmegaT, a free software to translate internal projects that I have with me.
One issue that I find while translating text files is that it does not take the line marks as a segment breaker. This can be changed by going into Options -> File Filters and under "Text Files", select options to choose the "Line Breaks" as the segment source.
- Details
- Category: Generalia
Create a symbolic link on windows:
Navigate to the directory in command prompt running in administrator mode, run this command:
mklink /D htdocs E:\htdocs
Move large amount of files (.txt files in example below) to a new folder (ubuntu):
find originalFolderName -name '*.txt' -exec mv {} targetFolderName/ \;
Bash Script for batch OCR using Tesseract where the output file starts with the name "hindi-xxx.png" and outputs each of the file with "text-" prefixed to it:
_________
#!/bin/sh
for i in hindi-*.png; do tesseract "$i" "text-$i" -l hin; done;
__________
Combile multiple text files with file name as the header /section on top. (Ubuntu)
tail -n +1 *.txt > combined.txt
Randomize the line numbers in a text file:
python -c "import random, sys; lines = open(sys.argv[1]).readlines(); random.shuffle(lines); print ''.join(lines)," D:\folder\test.txt > D:\Folder2\test_rand.txt
________
Count Unique lines in a large file (works on Ubuntu):
sort input.txt | uniq -c > output.txt
- Details
- Category: Generalia
I guess I am having a lot of free time or perhaps my being from JNU, currently the row throughout the world, I have been dabbling into a lot of debates in this regard, mostly on the social media (Facebook). However, I try to make it a point that I engage with only the people I know. The passions are too high, especially in the people associated with JNU. And there is chance that the debate might turn sour and debaters would step down to the level of getting personal or generalizing the person in front, as if the debater represents everyone who, supposedly, vouches for the idea he is speaking for.
Read more: How to get called a "Rapist" by a "true intellectual"?
- Details
- Category: Generalia
I was once trying to run a grep command to a directory and looking for a string inside it.
While the directory I was looking into was in a different drive (F:) than that of the system drive (C:) where the grep was installed.
I used the command prompt to first descend into the directory. So, I first went into the directory such that my command prompt looked like as follows:
F:\MySearchDirectory>
- Details
- Category: Generalia
How to replace spaces from directories with an underscore in linux?
A Bash command like the following can do this. On your terminal, you need to be in the directory going down from where you want to change the directories. Please note that the following command does the replacements recursively. SO, even the sub-directories would have its spaces replaced with an underscore:
find -depth -name "* *" -execdir rename 's/ /_/g' "{}" \;
If you do not want to do it recursively also into sub-directories, you should fire the following command:
find -name "* *" -type d | rename 's/ /_/g'