Hi all,
At first I want to thank you for your help. I really appreciate it!!
I surprised how many different kinds of possibilities there are to solve these issues.
It reminds me of an article from the pinguin magazin in middle Europe, a going to write something about this later.
I've tested your solutions and I found out the following different things :
DEVTAKH -- your solution is working fine for a small amount of data, but if the csv file has more than 200 lines a lot of lines are lost!
Maybe your string matches with some of the characters in my csv file.
$ cat test.csv | wc -l
552
$ cat test.csv | grep "^;" | wc -l
1
$ time sed -n '/^;.*/!{$!{N;s/\(.*\)\n\n*\(;.*\)*/\1\2/g;P;D};p}' test.csv | wc -l
276
real 0m11.108s
user 0m11.045s
sys 0m0.014s
DURDEN TYLER -- PANYAM --- GHOSTDOG74
your solution is working well, too thanks.
$time awk 'BEGIN {i=0;} { if (substr($0,1,1)==";") {a[i]=a[i]""$0} else {a[++i]=$0} } END { for (i in a) print a[i];}' test.csv | wc -l
551
real 0m0.106s
user 0m0.091s
sys 0m0.015s
$ time ./test_perl.sh test.csv | wc -l
550
real 0m0.348s
user 0m0.335s
sys 0m0.012s
$ time ./test.py test.csv | wc -l
549
real 0m0.310s
user 0m0.038s
sys 0m0.023s
About the article I just want to say that:
There was an assignment of tasks to work on a text file that was about 1GB.
The assignment was to convert the text file a shortest time.
All languages and scripts were allowed �from python awk to java�.
If you are interested in this I will write more about it.
Let me know.