Page 1 of 1
Find inconsistency in column
Posted: Fri Jul 18, 2008 3:19 am
by garthca
Hi,
I have large files say around 600,000 lines. These are always a set lenght eg 1191 characters. I need to search theses files to find out if the is anything wrong out of order in the file. If I use the following I can find errors on the first line ^\
000487637 INCO C 589501 D012 N 000
000487645 INCO C 589501 D012 N 000
1EA ACCES POINT P/N:AIR-AP1242MNTGKI
000487652 INCO C 589501 D012 N 000
000487660 INCO C 589501 D012 N 000
000487678 INCO C 589501 D012 N 000
000487686 INCO C 589501 D012 N 000
How can I find this at the end of the line like this on column 1191
123456789.1234
123456789.1234
123456789.1234
123456789.1234
123456789.1234
I used to be able do a column seach and text pad would stop where there was a gap in the data but I can't remeber how to do it. I also need to be able to do this on any column ie from 1 to 1191 as our our data is extrcted to specific columns.
Thanks

Posted: Fri Jul 18, 2008 11:05 am
by ben_josephs
I have very little idea what you mean.
If you are looking for lines that are 1191 characters long and end with
123456789.1234, try this:
Find what: ^.{1177}123456789\.1234$
[X] Regular expression
Note that 1177 = 1191 - 14, and 14 is the length of
123456789.1234.
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
If this is not what you want, please explain your problem more clearly.
Posted: Fri Jul 18, 2008 7:30 pm
by Bob Hansen
Thanks for the samples, but they don't make sense with your comments.
What is the error that you see on the first line?
What do you see at the ends of the other lines?
Please try again to explaining the problem.
More information
Posted: Sun Jul 20, 2008 11:33 pm
by garthca
Thanks for the responces and sorry I did not explain it very well. so I try again. We extract data from a system and it msut be in a set format. So Column A is 16 charters, Column B 4 ect up to the end of the line being at 1191. If, when extratced there is a hidden character the line will finish at a different lenght. Like below. So on the fourth line I wouls expect to see some numbers not a space. In this file this is actually line 43068 of a 632123 line text file. What I am trying to do is do a column search on say Column 1 - 16 or 18 -22 and do a check to see if there were spaces (like in the 4th line) where there should not be.
000487629 INCO C 589501 D012 N
000487637 INCO C 589501 D012 N
000487645 INCO C 589501 D012 N
This ia actully space in the text file 1EA ACCES POINT P
000487652 INCO C 589501 D012 N
000487660 INCO C 589501 D012 N
000487678 INCO C 589501 D012 N
I am sure I used to be able to use Ctrl - ALt - down arrow and it would only select whrere there was data. SO in summary I want to be able to do a column search on any column or columns to check on on data structure is correct throught the whole file. This might be at the start, middle or end of the line.
Posted: Mon Jul 21, 2008 7:44 am
by ben_josephs
I still don't fully understand what you need. I don't know what a hidden character is.
To find lines whose first character is a space:
Find what: ^_ [Replace the underscore with a space]
[X] Regular expression
To find lines whose 18th character is a space:
Find what: ^.{17}_ [Replace the underscore with a space]
[X] Regular expression
To find lines longer than 1190 characters:
Find what: ^.{1191,}
[X] Regular expression
The second and third of these require Posix regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
Posted: Wed Jul 23, 2008 5:19 am
by garthca
Thanks for the help
the ^.{17}_ is the one I'll be using as I can now do a search to make sure that we don't have any blanks where we should have data.
