Skip to main content

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

Project description

#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

Project details


Release history Release notifications

This version
History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
str_concat_to_line-0.1.tar.gz (3.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page