Hello
I have been having a problem with tab delimited lists lately, when I process the list through perl since there are extra Line breaks that are not supposed to be there it messes the list up
example
name company address city st zip*
karl associated 110 south *Fargo nd 58102*
I put these asteriks in place where the Line breaks are so you can see what I mean, for some reason I have a line break in the middle of the row and this character shows up in the text file as a little black rectangle
after using regular expressions for LF CR and that type of thing I found out that if I remove just an LF it removes them all, seems this rectangle has a property of a regular line feed and I have been really thinking what would be the best way to just eliminate the one in the middle where you see word Fargo, I want that one gone or any of them gone until it gets to the last column Zip
here are my thoughts on this, could I somehow count the columns
use this as a variable and somehow put this in a regular expression so I could erase all the line breaks as long as they are before my last column
could I count tabs in the regular expression?
or should I take all line breaks out after counting how many tabs or words between tabs that I have in the header and use this to replace a LF after so many columns?
I am trying at first come up with a solution before I start to make a code
if I could have any hints tips, regular expressions or any advice from this point on what I am trying to do
perhaps there is a much easier way, I almost gave up but lately I really think that something can be done
thanks again
John
You're Browsing As A Guest! Register Now... |
||
|
Become an Expert!
Join 416,736 Programmers for FREE! Get instant access to thousands
of experts, tutorials, code snippets, and more! There are 2,927 people online right now.Registration is fast and FREE... Join Now!
|
||
Page 1 of 1
Perl counting columns, using regular expression to count tabs regular expressions for counting tabs
Page 1 of 1


Ask A New Question
Reply





MultiQuote






|