making a dicomdir-File useing dcmtk: useing "absolute" Path? - dicom

I want to create a dicmdir file using dcmmkdir where the file-path isn't the same as the dicomdir-path.
Example:
File stored in C:\Dicompath
Dicomdir should be stored in H:\tmp
dcmmkdir -v +r -Pmi +D H:\tmp\ +id C:\Dicompath\
Does anybody know what I have to do getting my vision?
thanks
GGK

According to the documentation for the associated dcmgpdir application, you need to specify a file name with the +D option. For most reliable outcome, I also believe you need to specify a (dummy) file name pattern with option +p:
dcmmkdir -v +r -Pmi +D H:\tmp\DICOMDIR +id C:\Dicompath\ +p *.*

Related

What does the "-Np1" option for the patch command do?

Someone sent me a patch and told me to apply it using the command:
patch -Np1 -i file.patch
Out of curiosity, I tried to find out what the -Np1 option does but the patch man page is curiously opaque on this. Can anyone explain what this does? Thanks.
It's two flags. -N and -p1.
-N or --forward
Ignore patches that seem to be reversed or already applied. See
also -R.
and
-pnum or --strip=num
Strip the smallest prefix containing num leading slashes from each
file name found in the patch file. A sequence of one or more adja-
cent slashes is counted as a single slash. This controls how file
names found in the patch file are treated, in case you keep your
files in a different directory than the person who sent out the
patch. For example, supposing the file name in the patch file was
/u/howard/src/blurfl/blurfl.c
setting -p0 gives the entire file name unmodified, -p1 gives
u/howard/src/blurfl/blurfl.c
without the leading slash, -p4 gives
blurfl/blurfl.c
and not specifying -p at all just gives you blurfl.c. Whatever you
end up with is looked for either in the current directory, or the
directory specified by the -d option.

To find the filename who use the particular account name in unix server

I have to prepare one sheet like below. I want to find those files where we have used EDW account. But when I am using find command then it is returning everything which contains the word EDW. Even it returns those file don't have permission & can't open etc (printing unnecessary line).
I only need to print those file using the account name EDW,GDW etc with path name & file name. So that I can prepare one sheet as below.
AccountName Server Path name File name
XCM uk0300uv550 /home/super/MKBP/scripts/xtc/rap proc_build.sql
Can anyone please help me ?
If I understand your question correctly, you want a list with all files where "EDW" occurs? Try -l to list just the filenames and -r to grep recursively:
echo "Text with EDW inside." > file.txt
grep -lr EDW .
If you would like to find files that are owned by a specific user/group, you could simply use:
find /path/ -user EDW -group EDW
If you would like to find only files that are both owned by your user and contain the word EDW in their name you could:
find /path/ -user EDW -name "*EDW*"

Trim a file name in Unix

I have a file with name
ROCKET_25_08:00.csv
I want to trim the name of the file to
ROCKET_25_.csv
I tried mv but mv is not what I required because there will be cases where the files may be more than one.
I want the name till the second _.
How to get that in unix.
Please advise.
There are some utilities that provide more flexible renaming. But one solution that won't use anything other but included UNIX tools (like sed) would be:
ls -d * | sed -re 's/^([^_]*_[^_]*_)(.*)(\....)$/mv -v \1\2\3 \1\3/' | bash
This will only work in one directory, it won't process subdirectories.
It's not at all clear what you are actually trying to do, but if you just want to remove text between the last underscore and the period, you can do:
f=ROCKET_25_08:00.csv
echo ${f%_*}_.csv

How to generate translation file (.po, .xliff, .yml,...) from a Symfony2/Silex project?

Im going to build a Silex/Symfony2 project and I have been looking around for a method to generate XLIFF/PO/YAML translation files based on texts-to-be-translated inside the project but not found any instruction or documentation on it.
My question is: Is there an automated way to generate translation file(s) in specific format for a Symfony2/Silex project?
If yes, please tell me how to generate the file then update the translation after that.
If no, please tell me how to create translation file(s) then adding up more text for my project? I am looking for an editor desktop based or web-based instead of using normal editor such as Transifex, GetLocalization (but they dont have option to create a new file or add more text)
After a long time searching the internet, I found a good one:
https://github.com/schmittjoh/JMSTranslationBundle
I see you've found a converter, but to answer your first question about generating your initial translation file -
If you have Gettext installed on your system you could generate a PO file from your "texts-to-be-translated inside the project". The command line program xgettext will scan the source files looking for whatever function you're using.
Example:
To scan PHP files for instances of the trans method call as shown here you could use the following command -
find . -name "*.php" | xargs xgettext --language=PHP --keyword=trans --output=messages.pot
To your question about editors:
You could use any PO editor, such as POEdit, to manage your translations, but as you say you eventually need to convert the PO file to either an XLIFF or YAML language pack for Symfony.
I see you've already found a converter tool. You may also like to try the one I wrote for Loco. It supports PO to YAML, and PO to XLIFF
Workaround for busy people (UNIX)
You can run the following command in the Terminal:
$ grep -rEo --no-filename "'.+'\|\btrans\b" templates/ > output.txt
This will output the list of messages to translate:
'Please provide your email'|trans
'Phone'|trans
'Please provide your phone number'|trans
...
I mean almost.. But you can usually do some work from here...
Obviously you must tweak the command to your liking (transchoice, double-quotes instead of single...).
Not ideal but can help!
grep options
grep -R, -r, --recursive: Read all files under each directory, recursively this is equivalent to the -d recurse option.
grep -E, --extended-regexp: Interpret PATTERN as an extended regular expression.
grep -o, --only-matching: Show only the part of a matching line that matches PATTERN.
grep -h, --no-filename: Suppress the prefixing of filenames on output when multiple files are searched.
(source)

Ack: Search directory tree for files with a particular extension

I basically just want to do ack foo *.citrus and have ack drill down and find the string 'foo' in all Citrus files in the current directory and below. The trouble is that this won't work if there aren't any Citrus files in the current directory.
I tried messing with -G without success. Do I really need to add a file type in .ackrc just to limit the search to files with a given extension?
As suggested by Andy Lester, you can also create a typeset without taking the trouble to add it in your .ackrc file:
ack --type-set=cit=.citrus --cit "foo"
By default, ack searches only in files with known types ( like *.java, *.cpp etc. ). It doesn't know about files *.citrus, so to search in such files you must use -a cmd line switch:
$ack -a -G '\.citrus$' foo
1.d/1.citrus
1:foo_bar
You don't have to set it in .ackrc if you don't want. You can also set ACK_OPTIONS in your environment, or specify --type-set arguments on the command line. ack doesn't care.

Resources