rename_general
esta.general.rename_general
¶
to_file_any(iname, str_indx, first_indx_only=None, file_extension=None)
¶
renaming files (xyz/POSCAR, or any file extension possible) to a name derived from the part of the original filename.
Parameters:
iname: str name of the input file str_indx: list or list of lists part of the name of input file e.g [1,-2] separated by _ separator. The last index may be ignored usin first_indx_only option (see next data type) first_indx_only (optional): whether to ignore the last str_indx in the in the input file name. if True then the -2 in the str_indx=[1,-2] is ignored. And if False then -2 is included i.e. str_indx = [1,-2+1] is taken (all strs/data with indices from 1 to -2 is taken, Note that in python last index is excluded) If list of list: example: [[0,1],[3,4]]; the last index is included in the implementation first_indx_only: boolean whether only first index in the list indices to be considered; if false both list input indices are considered file_extension: str may be xyz or POSCAR or any extension (e.g. .in, so on)
Returns:
renamed input file/files
to_file(iname, str_indx, first_indx_only=None, file_extension=None)
¶
renaming files to a name derived from the part of the original filename.
parameters:
iname: name of the input file str_indx: part of the name of input file e.g [1,-2] separated by _ separator. The last index may be ignored usin first_indx_only option (see next data type) first_indx_only (optional): whether to ignore the last str_indx in the in the input file name. if True then the -2 in the str_indx=[1,-2] is ignored. And if False then -2 is included i.e. str_indx = [1,-2+1] is taken (all strs/data with indices from 1 to -2 is taken, Note that in python last index is excluded)