I have a Log file which need to be parsed and analysed. File contains something similar like below:File:20141101 server contain dump20141101 server contain nothing    {uekdmsam ikdas jwdjamc ksadkek} ssfjddkc * kdlsdlsddsfd jfkdfk 20141101 server contain dumpBased on the above scenario, I have to check if the starting line doesn't contain date or Number I have to append to previous line.Output file:20141101 server contain dump20141101 server contain nothing {uekdmsam ikdas jwdjamc ksadkek} ssfjddkc * kdlsdl sddsfd jfkdfk 20141101 server contain dumpI'm not good at awk, and require some help.
How to append Line to previous Line?
text processing;sed;awk
A version in perl, using negative lookaheads:$ perl -0pe 's/\n(?!([0-9]{8}|$))//g' test.txt20141101 server contain dump20141101 server contain nothing    {uekdmsam ikdas jwdjamc ksadkek} ssfjddkc * kdlsdlsddsfd jfkdfk20141101 server contain dump-0 allows the regex to be matched across the entire file, and \n(?!([0-9]{8}|$)) is a negative lookahead, meaning a newline not followed by 8 digits, or end of the line (which, with -0, will be the end of the file).