Originally Posted by maddyfreaks
I want the multiple lines in file to be starting with Rep and ending with year.
So the file i made it to singel line. But the num of feilds are not same . I want the missing feild to be inserted as some text.
for 2nd line am missing 3rd columns so i want to fill it with some dummy value.
either make or add missing 3rd col in straight line
make or add 3rd line for the file
This is hopeless. Do even you
know, for sure, what your desired output is supposed to be. Or is that defined by some entity whispering to you!?!
Sorry if I sound slightly vexed, but this is the second thread where you alter either the input or the desired output and/or change the criteria for your problem.
I am not trying to be mean or disrespectful - but this is, quite frankly, aggravating.
Tell you what, I am going to give you a solution, to your ORIGINAL problem, as specified by you here
. You'll get this for free, as in "gratis", and after that I will stay the **** out of your threads.
Here it comes:
cat maddyfreaks.txt | tr '\n' '+' | sed 's/\(Rep N[0-9]+Forever\)/\1 Yours/;s/\(Rep N[0-9]\)+\([A-EG-Z]\)/\1+Healthy Wealthy+\2/' | tr '+' '\n'
Take care and all that. I'm out.