Skip to content

elkanamol/combine_txt_files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

combine_txt_files

cli tool to combine text files to one file

Log File Combiner

This tool combines text log files for different IMEI numbers into a single output file. the tool design for files named by serial number and are stored in folders named by serial number. you can change the path to your path.

Usage

python combine_imei_logs.py [-h] [-c CSV] [-m MODEL] [-s ADDRESS] [-u USERNAME] [-d]

Required arguments:

-c, --csv CSV - Path to input CSV file containing list of IMEI numbers

Optional arguments:

-h, --help - Show help message and exit.

-m, --model MODEL - Model name (e.g. em9191) to determine log file location on server. Default is 'em9191'.

-s, --address ADDRESS - IP address of SSH server. Default is '10.148.38.142'.

-u, --username USERNAME - SSH username. Default is 'jade'.

-d, --debug - Enable debug logging.

How it works

  • The script connects via SSH to a remote server containing log files for different IMEI numbers.
  • It takes a CSV file as input with the list of IMEI numbers to combine.
  • For each IMEI, it constructs the file path on the remote server and uses SSH to concatenate the contents.
  • A separator string is added between each log file in the output.
  • Finally, the combined log text is written to a local output file.

Debug logging can be enabled to see details on the files being processed.

About

cli tool to combine text files to one file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages