str_concat_to_line

concatenate two strings to beginning and end of the lines of a file


Keywords
string concatenate line file append add join
License
Other
Install
pip install str_concat_to_line==0.1

Documentation

strings concatenate to lines

Simple python 3 script that get two strings and concatenate them to beginning and end of the lines of a file.

Table Of contents

  • Install On Linux
  • Example
  • More
    • Install from source/git
    • Step By Step example

Install On Linux:

sudo pip3 install str_concat_to_line

    or

sudo pip install str_concat_to_line

Example:

from str_concat_to_line.str_concat_to_line import sctl

first_str = "Yeh, it works"
second_str = "HooooRaaaaa"

input_file = "ex.txt"
out_file = "ex.txt.o"

foo = sctl(first_str , second_str , input_file , out_file);
foo.con_strs()

print("Finish")

Now you can see ex.txt.o file.

More

Install from source/git

git clone "https://github.com/mlibre/str_concat_to_line"
cd str_concat_to_line/
sudo python3 setup.py install

Step By Step Example

  1. open terminal
  2. create a file like test.py on your Linux
    touch test.py

    3. copy and past this code in test.py

from str_concat_to_line.str_concat_to_line import sctl

first_str = "Yeh, it works"
second_str = "HooooRaaaaa"

input_file = "ex.txt"
out_file = "ex.txt.o"

foo = sctl(first_str , second_str , input_file , out_file);
foo.con_strs()

print("Finish")

    4. run code

    python3 test.py

    or

    python test.py