How to deal with more than 1 input in a line - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: How to deal with more than 1 input in a line (/thread-11611.html) |
How to deal with more than 1 input in a line - mmaz67 - Jul-18-2018 Hi, can i know how to deal with line that sometimes have 1 input but sometimes have more. Is there any hint on what can i used to deal with this. I have few files, where the inputs varies. Example: file_a.txt input a, b, c, d file_b.txt input a input b file_c.txt input a,b,d,e,f,g,add,summI am planning to create a script that can list out the input one by one, line by line. Example output: out_a.txt input a input b input c input d out_b.txt input a input b out_c.txt input a input b input d input e input f input g input add input summI am currently manage to work with line that only have one input by using if else condition: if "input" in line: f0.write(line) RE: How to deal with more than 1 input in a line - ichabod801 - Jul-18-2018 You need to do three things:
|