Jump to content

Adding Up Lines


benjiej

Recommended Posts

I am a little lost, to be honest I don't even know where to begin on this one. I need to count the lines of that returns on my script. I will attach an example. There is nothing that I can find that leads me in the right direction on this. The last line I show tallies the lines above and then puts them in B RECS. I have everything but the B RECS any help would be greatly appreciated.

PID=xxxxxx XXXXXXXX SID=xxxxxx XXXXXXXX START 100129 3.0.0 S0000xxxxxxDEPOSIT1234 AUAX371449635398431 1210000000006989840 1 ABEMPLOYER *SERVICES D US A21 ADP BLVD A3ROSELAND, NJ 07068 B RECS=000000005

Benjie

Link to comment
Share on other sites

That doesn't have anything to do with MySQL, but OK. The common way to count lines is to count the number of newlines. If the only place you're writing code is on the database, and you're not using another scripting language, then you'll need to check the database manual to look for a way to count characters, or count lines, or split a string (e.g. explode), or some way that lets you count these things. In other words, the first step is to figure out what you have available to use.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...