tr or sed ? or some other tool
by dmchess from LinuxQuestions.org on (#4VKB9)
I had some personal data on a web site, I copied and pasted it to a text editor and saved it. Unfortunately, each line of the web site had (which had 6 fields) became six separate lines. I used the tr command to change all the new-lines to semicolons. The last field was identical in all but two records, so I used sed to change that end of field back to a new line. Then I just did minor edits to fix the other two lines. I then used a simple pascal program to suck the data into a mysql table.
My question is, if that last field hadn't had mostly identical data. Is there a way to force a newline after every 6th field?
Terry H.


My question is, if that last field hadn't had mostly identical data. Is there a way to force a newline after every 6th field?
Terry H.