Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count pipes in delimited file (embedded CRLF's)

Status
Not open for further replies.

bigbalbossa

Programmer
Mar 21, 2002
87
US
Alright folks...i didn't think this would be too difficult, but it's turning into quite a chore.

I have 7GB pipe delimited file that seems to have line feeds in the wrong place. There should be 18 pipes per line, however, when i run a script that does a count i get:

There are 1 line(s) with 12 pipes
There are 24 line(s) with 2 pipes
There are 6 line(s) with 20 pipes
There are 3 line(s) with 14 pipes
There are 4 line(s) with 4 pipes
There are 45873912 line(s) with 18 pipes
There are 2 line(s) with 0 pipes
There are 23 line(s) with 16 pipes
There are 126 line(s) with 19 pipes
There are 1 line(s) with 13 pipes
There are 1 line(s) with 5 pipes

Is there a way to remove all CRLF's, count 18 pipes, then add a CRLF?

Any ideas are much appreciated.
 
Easy does it Duncs.
I don't think Scanner18 was bitching, just trying to help.
We all appreciate your efforts and agree that your code is an excellent idea. :)


Trojan.
 
Hi Trojan

Sorry! Wasn't bitching! Just giving the OP a little credit... after all he did quite plainly state that he was all sorted and even posted examples of adjustments he had made. Just thought it was moot point.

Just trying to install ICQ... but they all seem to be being slagged on OS X !?


Kind Regards
Duncan
 
Does "Gaim" work on OS X?
I don't use OS X so I can't help much.
Gaim is multiprotocol and so can handle MSN, ICQ and many others all at the same time.


Trojan.
 
I'm not having an easy time installing this!


Kind Regards
Duncan
 
Cheers Trojan - i'll get back to you

Seems like this might only be available for Tiger - and i'm on Panther. Never easy is it!!! :)


Kind Regards
Duncan
 
Nope but if you can get Gaim working it could be invaluable since it supports so many protocols.
Do you use any other IM software and/or protocols at the moment?


Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top