csv - pipeline delimiter issue having constraints -


i need code or program edit csv-file following conditions should hold:

  1. the no. of pipes | in each row / line should 14

  2. if 14 pipes not present there must data has moved following lines. need trim lines , merge them previous line ensure having 14 pipes.


sample data csv-file (added due comments):

  • correct line:

    ab|bfgc|cd|gfdgde|ef|fg|gh|hi|jdsfk|kl|lm|mfdgn|nq|ql|df 
  • wrong line:

    dkflmd|bgbfdsfd|sfsddf|efdgfdg sdfsd|dfgdf|gfdhdfh|gfdg| sdfs|gdf| sdgdf gfdgedf|dfy| 

some of data in first line of wrong code has been shifted next line need program can trim next line , append previous line.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -