Hello,
I have a large database with the following structure:
set of clustered names followed by a hard return and followed by a second set of clustered names and so on. Sometimes the clusters can be as many as 150.
Since the data is in an Indian language, a theoretical example will make this clear.
What I need is to convert the series of lists to a single row so that the desired output is as under:
I have been using a simple macro to do the job, but given the size of the file which runs to over 300 thousand names, the macro is too slow and takes time.
A perl or awk script would be most helpful.
Many thanks in advance
$FILE_NAME="abc.txt";
$/="\n\n";
open(FH_R,"<",$FILE_NAME)|| die "Unable to open $FILE_NAME for reading: $!\n";
while (<FH_R>)
{
chomp;
s/\n+/=/g;
print "$_\n";
}
close FH_R;
Many thanks for all the responses which I got.
All the scripts both in Perl and AWK worked perfectly.
I could not implement sed since I am in windows environment and sed does not work under Windows. I am sorry but I should have mentioned that.